Practice Python Exercises & Challenges with Solutions [460+ Coding Questions]
Free Coding Exercises for Python Developers. Practice Python with 20 topic-wise exercises with over 463 coding questions covering everything from Python basics to advance.
What included in these Python Exercises?
- All exercises are tested on Python 3.
- Each exercise contains 15-30 coding questions or challenges, focusing on specific Python topics to give you targeted practice
- Reference articles are provided for help.
- Hint and solutions are provided for every question this enables you to immediately check your code and learn from any mistakes
- Practice each Exercise in Online Python Code Editor
Whether you're a beginner taking your first steps or an experienced developer looking to refine your skills, these exercises are designed to be beneficial.
Also, See:
- Learn Python to solve these exercises.
- Python Quizzes: 14 Different Python quizzes
- Python Interview Questions and Answers
Below are the list of exercises. Select the exercise you want to solve. All the Best.
Basic Exercise for Beginners
Total Exercises: 40
This Python beginner’s exercise helps you quickly learn and practice basic skills by solving coding questions and challenges on below topics.
Topics: Python Basics, Variables, Operators, Loops, String, Numbers, List
Python Loop Exercise
Total Exercises: 40
This exercise contains coding challenges to solve using if-else conditions, for loops, the range() function, and while loops.
Topics: Control flow statements, Loop, and while loop
Intermediate Python Exercises
Total Exercises: 65
Intermediate Python coding exercises primarily focuses on loops, strings, list, dictionary, sets, decorators, Generators (yield), OOP, and multi-threading, List/Dict comprehensions, and Lambda functions, File Handling, regular expression, Date and Time, other miscellaneous topics.
Python Input and Output Exercise
Total Exercises: 23
Solve coding questions on input and output operations in Python. Also, we practice file handling.
Topics: Python I/O, File I/O
Python Functions Exercise
Total Exercises: 18
Practice how to create a function, nested functions, and use the function arguments effectively in Python by solving different questions.
Topics: Functions arguments, built-in functions.
Python String Exercise
Total Exercises: 38
Solve Python string coding questions to learn and practice string operations and manipulations.
Python Data Structure Exercise
Total Exercises: 10
Practice coding questions on widely used Python types such as List, Set, Dictionary, and Tuple.
Python List Exercise
Total Exercises: 45
This exercise contains coding questions to learn and practice list operations, manipulations, functions, and list comprehension.
Topic: Python List
Python Dictionary Exercise
Total Exercises: 20
This exercise contains coding questions to help Python developers to learn and practice dictionary operations and manipulation.
Topic: Python Dictionary
Python Set Exercise
Total Exercises: 16
Practice and solve various set operations, manipulations, and set functions.
Topic: Python Sets
Python Tuple Exercise
Total Exercises: 19
Practice and solve various tuple operations, manipulations, and tuple functions.
Topic: Python Tuples
Python Date and Time Exercise
Total Exercises: 10
This exercise aims to help Python developers to learn and practice DateTime and timestamp coding problems.
Topics: Date and Time, time, Date, Calendar.
Python OOP Exercise
Total Exercises: 10
This Python Object-oriented programming (OOP) exercise aims to help Python developers to learn and practice OOP concepts.
Topics: OOP, Object, Classes, Inheritance
Python File Handling Exercise
Total Exercises: 15
This exercise contains coding questions to gain proficiency in file operations such as reading, writing, renaming a file, copying file, deleting a file, managing file properties, content filtering, and replacement.
Topics: File Handling
Python JSON Exercise
Total Exercises: 9
Practice and Learn JSON creation, manipulation, Encoding, Decoding, and parsing using Python
Topics: JSON
Python NumPy Exercise
Total Exercises: 50
Practice NumPy coding questions such as Array manipulations, numeric ranges, Slicing, indexing, Searching, Sorting, and splitting, and more.
Python Pandas Exercise
Total Exercises: 10
Practice Data Analysis using Python Pandas. Practice Data-frame, Data selection, group-by, Series, sorting, searching, and statistics.
Random Data Generation Exercise
Total Exercises: 10
Practice and solve coding questions to learn the various techniques to generate random data in Python.
Topics: random module, secrets module, UUID module
Python Database Exercise
Total Exercises: 5
Solve database coding problems to master database operations step by step.
Use any of the MySQL, PostgreSQL, SQLite to solve the exercise
Python Matplotlib Exercise
Total Exercises: 10
Practice Data visualization using Python Matplotlib. Line plot, Style properties, multi-line plot, scatter plot, bar chart, histogram, Pie chart, Subplot, stack plot.