GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • w3resource
  • Front End
  • HTML
  • CSS
  • JavaScript
  • HTML5
  • Schema.org
  • php.js
  • Twitter Bootstrap
  • Responsive Web Design tutorial
  • Zurb Foundation 3 tutorials
  • Pure CSS
  • HTML5 Canvas
  • JavaScript Course

This view

  • Original page
  • New address

GeezerVison is showing www.w3resource.com — Python Exercises, Practice, Solution - w3resource

  • Home
  • Python Home
  • ▼Python Exercises
  • Exercises Home
  • ▼Python Basic
  • Basic - Part-I
  • Basic - Part-II
  • Python Programming Puzzles
  • Mastering Python
  • ▼Python Advanced
  • Python Advanced Exercises
  • ▼Python Control Flow
  • Condition Statements and Loops
  • Recursion
  • ▼Python Data Types
  • String
  • JSON
  • List
  • List Advanced
  • Dictionary
  • Tuple
  • Sets
  • Collections
  • Array
  • Enum
  • ▼Python Class
  • Class
  • ▼Python Concepts
  • Python Unit test
  • Python Exception Handling
  • Python Object-Oriented Programming
  • Decorator
  • ▼Functional Programming
  • Functions
  • Lambda
  • Map
  • Itertools
  • Filter Function
  • ▼Date and Time
  • Date Time
  • Pendulum Module
  • ▼File Handling
  • File I/O
  • CSV Read, Write
  • ▼Regular Expressions
  • Regular Expression
  • ▼Data Structures and Algorithms
  • Search and Sorting
  • Linked List
  • Binary Search Tree
  • Heap queue algorithm
  • Bisect
  • ▼Advanced Python Data Types
  • Boolean Data Type
  • None Data Type
  • Bytes and Byte Arrays
  • Memory Views exercises
  • Frozenset Views exercises
  • NamedTuple exercises
  • OrderedDict exercises
  • Counter exercises
  • Ellipsis exercises
  • ▼Concurrency and Threading
  • Threading
  • Asynchronous
  • ▼Python Modules
  • Modules
  • Operating System Services
  • Math
  • Requests
  • SQLite Database
  • SQLAlchemy
  • PPrint
  • ▼Miscellaneous
  • Cyber Security
  • Generators Yield
  • ▼Python GUI Tkinter, PyQt
  • Tkinter Home
  • Tkinter Basic
  • Tkinter Layout Management
  • Tkinter Widgets
  • Tkinter Dialogs and File Handling
  • Tkinter Canvas and Graphics
  • Tkinter Events and Event Handling
  • Tkinter Custom Widgets and Themes
  • Tkinter File Operations and Integration
  • PyQt Basic
  • PyQt Widgets
  • PyQt Connecting Signals to Slots
  • PyQt Event Handling
  • ▼Python NumPy
  • Python NumPy Home
  • ▼Python urllib3
  • Python urllib3 Home
  • ▼Python Metaprogramming
  • Python Metaprogramming Home
  • ▼Python GeoPy
  • Python GeoPy Home
  • ▼BeautifulSoup
  • BeautifulSoup Home
  • ▼Arrow Module
  • Arrow Home
  • ▼Python Pandas
  • Python Pandas Home
  • ▼Pandas and NumPy Exercises
  • Pandas and NumPy Home
  • ▼Python Machine Learning
  • Machine Learning Home
  • TensorFlow Basic
  • ▼Python Web Scraping
  • Web Scraping
  • ▼Python Challenges
  • Challenges-1
  • ▼Python Mini Project
  • Python Projects
  • ▼Python Natural Language Toolkit
  • Python NLTK
  • ▼Python Project
  • Novel Coronavirus (COVID-19)
  • ..More to come..

Python Exercises, Practice, Solution

Last update on October 29 2025 11:59:42 (UTC/GMT +8 hours)


This resource offers a total of 9475 Python problems for practice. It includes 2029 main exercises, each accompanied by solutions, detailed explanations, and upto four related problems.

Python Exercises:

Python is a versatile, high-level language known for its readability and concise syntax. It supports multiple programming paradigms, including object-oriented, imperative, and functional styles. It features dynamic typing, automatic memory management, and a robust standard library. This section is dedicated to practice exercises for those with beginner to intermediate Python skills. Happy coding as you enhance your programming abilities!

Python Exercises Practice Solutions

You may read our Python tutorial before solving the following exercises.

List of Python Exercises :

Python Basics
  • Python Basic (Part -I) [ 750 Exercises ]
  • Python Basic (Part -II) [ 750 Exercises ]
  • Python Programming Puzzles [ 500 Exercises ]
  • Mastering Python [ 100 Exercises ]
Python Advanced
  • Python Advanced [ 120 Exercises ]
Python Control Flow
  • Python Conditional statements and loops [ 220 Exercises ]
  • Recursion [ 55 Exercises ]
Python Data Types
  • Python Data Types - String [ 565 Exercises ]
  • Python JSON [ 45 Exercises ]
  • Python Data Types - List [ 1400 Exercises ]
  • Python Data Types - List Advanced [ 75 Exercises ]
  • Python Data Types - Dictionary [ 450 Exercises ]
  • Python Data Types - Tuple [ 165 Exercises ]
  • Python Data Types - Sets [ 150 Exercises ]
  • Python Data Types - Collections [ 180 Exercises ]
  • Python Array [ 120 Exercises ]
  • Python Enum [ 25 Exercises ]
Python Class
  • Python Class [ 140 Exercises ]
Python Concepts
  • Python Unit test [ 50 Exercises ]
  • Python Exception Handling [ 50 exercises ]
  • Python Object-Oriented Programming [ 55 Exercises ]
  • Python Decorator [ 60 Exercises ]
Functional Programming
  • Python functions [ 105 Exercises ]
  • Python Lambda [ 260 Exercises ]
  • Python Map [ 85 Exercises ]
  • Python Itertools [ 220 exercises ]
  • Python - Filter Function [ 55 Exercises ]
Date and Time
  • Python Date Time [ 315 Exercises ]
  • Python Pendulum (DATETIMES made easy) Module [34 Exercises ]
File Handling
  • Python File Input Output [ 105 Exercises ]
  • Python CSV File Reading and Writing [ 55 exercises ]
Regular Expressions
  • Python Regular Expression [ 290 Exercises ]
Data Structures and Algorithms
  • Search and Sorting [ 195 Exercises ]
  • Linked List [ 70 Exercises ]
  • Binary Search Tree [ 30 Exercises ]
  • Python heap queue algorithm [ 145 exercises ]
  • Python Bisect [ 45 Exercises ]
Advanced Python Data Types
  • Python Boolean Data Type [ 50 Exercises ]
  • Python None Data Type [ 50 Exercises ]
  • Python Bytes and Byte Arrays Data Type [ 50 Exercises ]
  • Python Memory Views Data Type [ 50 Exercises ]
  • Python frozenset Views [ 50 Exercises ]
  • Python NamedTuple [ 45 Exercises ]
  • Python OrderedDict [ 50 Exercises ]
  • Python Counter [ 50 Exercises ]
  • Python Ellipsis (...) [ 45 Exercises ]
Concurrency and Threading
  • Python Multi-threading and Concurrency [ 35 exercises ]
  • Python Asynchronous [ 40 Exercises ]
Python Modules
  • Python built-in Modules [ 155 Exercises ]
  • Python Operating System Services [ 90 Exercises ]
  • Python Math [ 470 Exercises ]
  • Python Requests [ 45 exercises ]
  • Python SQLite Database [ 65 Exercises ]
  • Python SQLAlchemy [ 70 exercises ]
  • Python - PPrint [ 30 Exercises ]
Miscellaneous
  • Python - Cyber Security [ 50 Exercises ]
  • Python Generators Yield [ 85 exercises ]
  • More to come

Python GUI Tkinter, PyQt

  • Python Tkinter Home
  • Python Tkinter Basic [ 16 Exercises ]
  • Python Tkinter layout management [ 11 Exercises ]
  • Python Tkinter widgets [ 22 Exercises ]
  • Python Tkinter Dialogs and File Handling [ 13 Exercises ]
  • Python Tkinter Canvas and Graphics [ 14 Exercises ]
  • Python Tkinter Events and Event Handling [ 13 Exercises ]
  • Python Tkinter Customs Widgets and Themes [ 12 Exercises ]
  • Python Tkinter - File Operations and Integration [12 exercises ]
  • Python PyQt Basic [10 exercises ]
  • Python PyQt Widgets[12 exercises ]
  • Python PyQt Connecting Signals to Slots [15 exercises ]
  • Python PyQt Event Handling [10 exercises ]

Python Challenges :

  • Python Challenges: Part -1 [ 1- 64 ]
  • More to come

Python Projects :

  • Python Numbers : [ 11 Mini Projects ]
  • Python Web Programming: [ 12 Mini Projects ]
  • 100 Python Projects for Beginners with solution.
  • Python Projects: Novel Coronavirus (COVID-19) [ 14 Exercises ]
  • More to come

Learn Python packages using Exercises, Practice, Solution and explanation

Python urllib3 :

  • Python urllib3 [ 26 exercises ]

Python Metaprogramming :

  • Python Metaprogramming [ 12 exercises ]

Python GeoPy Package :

  • Python GeoPy Package [ 7 exercises ]

Python BeautifulSoup :

  • Python BeautifulSoup [ 36 exercises ]

Python Arrow Module :

  • Python Arrow Module [ 27 exercises ]

Python Web Scraping :

  • Python Web Scraping [ 27 Exercises ]

Python Natural Language Toolkit :

  • Python NLTK [ 22 Exercises ]

Python NumPy :

    Basic Operations and Arrays

  • Python NumPy Basic [ 59 Exercises ]
  • Python NumPy arrays [ 205 Exercises ]
  • Mathematics, Linear Algebra, and Statistics

  • Python NumPy Mathematics [ 41 Exercises ]
  • Python NumPy Linear Algebra [ 19 Exercises ]
  • Python NumPy Statistics [ 14 Exercises ]
  • Random Numbers

  • Python NumPy Random [ 17 Exercises ]
  • Sorting, Searching, and Indexing

  • Python NumPy Sorting and Searching [ 9 Exercises ]
  • NumPy Advanced Indexing [ 20 exercises ]
  • Datetime and String Operations

  • Python NumPy DateTime [ 7 Exercises ]
  • Python NumPy String [ 22 Exercises ]
  • Broadcasting and Memory Layout

  • NumPy Broadcasting [ 20 exercises ]
  • NumPy Memory Layout [ 19 exercises ]
  • Performance Optimization and Interoperability

  • NumPy Performance Optimization [ 20 exercises ]
  • NumPy Interoperability [ 20 exercises ]
  • Input/Output (I/O) Operations

  • NumPy I/O Operations [ 20 exercises ]
  • Functions and Masked Arrays

  • NumPy Universal Functions [ 20 exercises ]
  • NumPy Masked Arrays [ 20 exercises ]
  • Structured Arrays and SciPy Integration

  • NumPy Structured Arrays [ 20 exercises ]
  • NumPy Integration with SciPy [ 19 exercises ]
  • Advanced Topics and Mastery

  • Advanced NumPy [ 33 exercises ]
  • Mastering NumPy [ 100 Exercises with ]
  • More to come

Python Pandas :

  • Python Pandas Home
  • Pandas Data Series [ 40 exercises with solution ]
  • Pandas DataFrame [ 81 exercises with solution ]
  • Pandas Index [ 26 exercises with solution ]
  • Pandas String and Regular Expression [ 41 exercises with solution ]
  • Pandas Joining and merging DataFrame [ 15 exercises with solution ]
  • Pandas Grouping and Aggregating [ 32 exercises with solution ]
  • Pandas Time Series [ 32 exercises with solution ]
  • Pandas Filter [ 27 exercises with solution ]
  • Pandas GroupBy [ 32 exercises with solution ]
  • Pandas Handling Missing Values [ 20 exercises with solution ]
  • Pandas Style [ 15 exercises with solution ]
  • Pandas Excel Data Analysis [ 25 exercises with solution ]
  • Pandas Pivot Table [ 32 exercises with solution ]
  • Pandas Datetime [ 25 exercises with solution ]
  • Pandas Plotting [ 19 exercises with solution ]
  • Pandas Performance Optimization [ 20 exercises with solution ]
  • Pandas Advanced Indexing and Slicing [ 15 exercises with solution ]
  • Pandas SQL database Queries [ 24 exercises with solution ]
  • Pandas Resampling and Frequency Conversion [ 15 exercises with solution ]
  • Pandas Advanced Grouping and Aggregation [ 15 exercises with solution ]
  • Pandas IMDb Movies Queries [ 17 exercises with solution ]
  • Mastering NumPy: 100 Exercises with solutions for Python numerical computing
  • Pandas Practice Set-1 [ 65 exercises with solution ]
  • More to come

Pandas and NumPy Exercises :

  • Pandas and NumPy for Data Analysis [ 37 Exercises ]
  • More to come

Python Machine Learning :

  • Python Machine learning Iris flower data set [38 exercises with solution]
  • More to come

More...

Note : Download Python from https://www.python.org/ftp/python/3.2/ and install in your system to execute the Python programs. You can read our Python Installation on Fedora Linux and Windows 7, if you are unfamiliar to Python installation.
You may accomplish the same task (solution of the exercises) in various ways, therefore the ways described here are not the only ways to do stuff. Rather, it would be great, if this helps you anyway to choose your own methods.

List of Exercises with Solutions :

  • HTML CSS Exercises, Practice, Solution
  • JavaScript Exercises, Practice, Solution
  • jQuery Exercises, Practice, Solution
  • jQuery-UI Exercises, Practice, Solution
  • CoffeeScript Exercises, Practice, Solution
  • Twitter Bootstrap Exercises, Practice, Solution
  • C Programming Exercises, Practice, Solution
  • C# Sharp Programming Exercises, Practice, Solution
  • PHP Exercises, Practice, Solution
  • Python Exercises, Practice, Solution
  • R Programming Exercises, Practice, Solution
  • Java Exercises, Practice, Solution
  • SQL Exercises, Practice, Solution
  • MySQL Exercises, Practice, Solution
  • PostgreSQL Exercises, Practice, Solution
  • SQLite Exercises, Practice, Solution
  • MongoDB Exercises, Practice, Solution

More to Come !

Do not submit any solution of the above exercises at here, if you want to contribute go to the appropriate exercise page.

[ Want to contribute to Python exercises? Send your code (attached with a .zip file) to us at w3resource[at]yahoo[dot]com. Please avoid copyrighted materials.]

Test your Python skills with w3resource's quiz



Follow us on Facebook and Twitter for latest update.


  • Daily Coding Challenges & Projects
  • Weekly Trends and Language Statistics



You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.