Python Exercises For All Levels - A Collection

If you are searching for Python Exercises to practice your programming skills, you came to the right place. This ever-growing list of Python Exercises is a collection of beginner-friendly Python coding challenges that help you to become a better Python programmer. We will keep adding new challenges to this list regularly, so make sure to bookmark and check back for new content.

Python Exercises Top

Table of Contents

Requirements

There is not much that you need to participate in any of these challenges. The only thing you need is a free Replit account. This is the easiest way to directly start coding and working on our challenges.

We provide a Starter Repl and a Solution Repl to each exercise. We encourage you to not look at the Solution Repl until you are completely stuck. Use Google to help find a solution and hone your Google skills at the same time. The best way to learn is to struggle.

How to fork a Repl

To fork a Repl you just have to click on the Starter Repl button, make sure you are logged in to your Replit account, and click on the Fork Repl button to create a copy of the Starter Repl we provide. This allows you to start coding directly.

Python Excercise 1 - Crypto Coin Name Generator

Difficulty: Very Easy

In this exercise, we will build a Crypto Coin Name Generator. This covers a lot of Python's basic functionality by using variables, inputs, and print.

Task

  1. Ask the user for his favorite toy as a kid using input and store it in a variable (If the toy has multiple words, just write it in PascalCase ex: ActionMan)
  2. Ask the user if the Crypto Coin should end with "Token", "Coin", or something else.
  3. Print the name of the new Crypto Coin to the console!
  4. Bonus: Make sure to print a newline character after asking the user a question so that the user has a clear input field!

Hints

You need to use the following Python functions to be able to solve this challenge:

  • print()
  • input()

Final Program

The final program should look like this:

Python Exercise 1 Final Program

Python Exercise 2 - BMI Calculator

Difficulty: Very Easy

In this exercise, we will create a BMI calculator! This will help us to better understand different data types and help us to learn how to use them in a program. The formula to calculate the BMI is:

Python Exercise 2

Task

  • Write a program that calculates a user's BMI using the user's weight and height.
  • BMI is calculated by dividing the person's weight in kg by the square of the person's height in meters.
  • Round the result to a whole number.

Hint

  1. Check the data types of your variables/inputs.
  2. If you can, use the exponent operator in your program.
  3. Convert your result to a whole number.

Final Program

If you make the following input:

height = 1.85 weight = 75

You should receive this output:

22

Based on the calculation using the BMI formula: 75 % (1.85 x 1.85)

Python Exercise 2

This result is already rounded. If you don't round, you will end up with a long floating point number!

Where to go from here?

After you have finished all of our exercises, make sure to bookmark this site since we keep adding new Python exercises on a weekly basis. If you want to learn even more about Python, we highly recommend checking out our Python section, where we teach you the Python programming language from the ground up in a beginner-friendly way!

🐍 Learn Python Programming
🔨 Python Basics
👉 Python Syntax
👉 Python Variables
👉 Python print()
⚙️ Python Specifics
👉 Python List Replace - Simplified
👉 Create a GUI in Python
👉 Find out the Length of a String in Python
🏋️ Python Exercises
👉 Python Exercise Collection

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Share via
Copy link
Powered by Social Snap