Python 3 Practice Problems for Beginners: 10+ Easy Code Exercises

Logan Jul 13, 2026

Embarking on your Python 3 journey? You've picked an excellent language – versatile, user-friendly, and widely used. But learning by just reading isn't enough.Here, we've gathered Python 3 practice problems explicitly designed for beginners like you. Roll up your sleeves and dive into these hands-on exercises to bolster your Python skills and boost your confidence.

Python Cheat Sheet for Beginners 2026 | Python Basics, Syntax, Loops, Functions & Variables
Python Cheat Sheet for Beginners 2026 | Python Basics, Syntax, Loops, Functions & Variables

Before we dive into the problems, let's ensure you're acquainted with some essential Python 3 basics. You should be comfortable with variables, data types, basic operators (+, -, *, /), and control structures like if/else and for/while loops. If not, re-visit those concepts to build a solid foundation.

Python Notes for Beginners (Easy + Quick Guide)
Python Notes for Beginners (Easy + Quick Guide)

Python Basics Revisited

Refreshing your memory on Python basics is crucial. Let's remind ourselves of some fundamental concepts that will help you solve these practice problems.

| Pythonista Planet
| Pythonista Planet

Data Types

Python 3 has four primary data types: Integers, Floats (decimals), Strings (sequences of characters), and Booleans. Here's a simple exercise:

All Important Python Functions for Beginners (Complete Cheat Sheet)
All Important Python Functions for Beginners (Complete Cheat Sheet)

```

Exercise: Write a Python program that declares and prints variables of each data type.

```

For example, your output should display an integer, a float, a string, and a boolean value.

Operators

Python Course For Beginners - GeeksforGeeks
Python Course For Beginners - GeeksforGeeks

Python 3 supports several operators, including arithmetic, comparison, assignment, and more. Here's an example to practice:

```

Exercise: Write a Python program that takes two numbers as input and performs the four basic arithmetic operations (addition, subtraction, multiplication, and division).

```

Remember to handle division by zero and modulus by checking if the second number is zero.

Python Basics Cheat Sheet for Beginners | Learn Coding Step by Step
Python Basics Cheat Sheet for Beginners | Learn Coding Step by Step

Control Structures

Control structures are vital for decision-making and looping in Python. Let's practice conditional statements and loops with these problems.

Start your Python journey with easy handwritten notes designed for beginners 💻
Start your Python journey with easy handwritten notes designed for beginners 💻
30 Python Projects For Beginners and Advanced Learners (2023)
30 Python Projects For Beginners and Advanced Learners (2023)
30-Day Python Learning Plan for Beginners | Complete Python Roadmap to Learn Coding Fast
30-Day Python Learning Plan for Beginners | Complete Python Roadmap to Learn Coding Fast
Python Projects Ideas For Beginners
Python Projects Ideas For Beginners
Python Programming Practice Questions Cheat Sheet 🐍
Python Programming Practice Questions Cheat Sheet 🐍
Python Cheat Sheet for Beginners
Python Cheat Sheet for Beginners
Python Operators Tutorial – Chapter 3 Notes
Python Operators Tutorial – Chapter 3 Notes
How to Practice Python for Beginners (Step-by-Step Guide)
How to Practice Python for Beginners (Step-by-Step Guide)
Python Tutorial
Python Tutorial
Python File Handling Explained for Beginners (Complete Guide)
Python File Handling Explained for Beginners (Complete Guide)
9 Python Projects for Beginners (Build Your Portfolio Fast)
9 Python Projects for Beginners (Build Your Portfolio Fast)
Python Coding Problem
Python Coding Problem
Best Free Websites to Learn Python for Beginners
Best Free Websites to Learn Python for Beginners
Python Functions Practice
Python Functions Practice
Shortcut to learn Python.[Cheatsheet]
Shortcut to learn Python.[Cheatsheet]
Python Practice Exercises for Beginners
Python Practice Exercises for Beginners
Python Tricks You Should Know
Python Tricks You Should Know
7 Python Projects Every Beginner Should Build 📊🐍
7 Python Projects Every Beginner Should Build 📊🐍

If/Else & Elif

The if/else statement is used for decision-making. Here's an exercise to practice if/elif:

```

Exercise: Write a Python program that takes a number and checks if it's positive, negative, or zero. Print an appropriate message for each case.

```

Use an if statement within a print function to display messages like 'Positive number', 'Negative number', or 'Zero'.

For & While Loops

Python supports both for and while loops. Let's practice using them in the following problem:

```

Exercise: Write a Python program that prints even numbers between 1 and 20 using both a for loop and a while loop.

```

This will help you understand and differentiate between the two looping mechanisms in Python.

Functions

Functions help break down complex programs into smaller, reusable pieces. Here's a problem to practice function definition and calling:

Defining & Calling Functions

Write a Python program that defines a function named 'greet' which takes a name as an argument and prints 'Hello, !'

Then, call this function with your own name and a friend's name.

crewsing Recursion

Recursion is a powerful concept where a function calls itself to solve smaller sub-problems. Let's tackle an exercise to understand recursion:

```

Exercise: Write a Python function that calculates the factorial of a given number using recursion.

```

Python Lists

Python lists are ordered collections of items separated by commas and enclosed in square brackets. They are mutable and can hold different data types. Let's practice list operations with these problems:

List Basics

Write a Python program that declares a list of integers, prints the initial list, appends an item, removes an item, and finally prints the updated list.

List Comprehension

List comprehensions provide a concise way to create lists. Let's practice them in this exercise:

```

Exercise: Write a Python program that uses list comprehension to square and print all numbers from 1 to 10.

```

The output should be [1, 4, 9, 16, 25, 36, 49, 64, 81, 100].

Keep practicing, and you'll notice your Python skills improving rapidly!