w3resource

Python Exercises, Practice, Solution

What is Python language?

Python is a widely used high-level, general-purpose, interpreted, dynamic programming language. Its design philosophy emphasizes code readability, and its syntax allows programmers to express concepts in fewer lines of code than possible in languages such as C++ or Java.

Python supports multiple programming paradigms, including object-oriented, imperative and functional programming or procedural styles. It features a dynamic type system and automatic memory management and has a large and comprehensive standard library

The best way we learn anything is by practice and exercise questions. We have started this section for those (beginner to intermediate) who are familiar with Python.

Hope, these exercises help you to improve your Python coding skills. Currently, following sections are available, we are working hard to add more exercises .... Happy Coding!

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

List of Python Exercises :

Python GUI tkinter

Python NumPy :

Python Challenges :

Python Mini Projects :

Python Pandas :

Python Machine Learning :

Learn Python packages using Exercises, Practice, Solution and explanation

Python GeoPy Package :

Python BeautifulSoup :

Python Arrow Module :

Python Web Scraping :

Python Natural Language Toolkit :

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 :

Popularity of Programming Language
Worldwide, Apr 2022 compared to a year ago:

`
Rank Change Language Share Trend
1 Python 27.95 % -2.2 %
2 Java 18.09 % +0.6 %
3 Javascript 9.14 % +0.5 %
4 C# 7.39 % +0.5%
5 C/C++ 7.06 % +0.4 %
6 PHP 5.48 % -0.9 %
7 R 4.41 % +0.5 %
8 up arrow TypeScript 2.27 % +0.5 %
9 down arrow Objective-C 2.23 % -0.3 %
10 down arrow Swift 2.06 % +0.2 %
11 up arrow Matlab1.84% +0.1 %
12 down arrow Kotlin 1.59 % -0.2 %
13 Go 1.27 % -0.1 %
14 up arrow Rust 1.25 % +0.3 %
15 Ruby 1.09 % -0.1%
16 down arrow VBA 1.07 % -0.2 %
17 up arrow Ada 0.8 % +0.1 %
18 up arrow Scala 0.69 % +0.1 %
19 up arrow Dart 0.69 % +0.1 %
20 up arrow Abap 0.67 % +0.1 %
21 down arrow Visual Basic 0.62 % -0.1%
22 down arrow Lua 0.5 % -0.1 %
23 up arrow Groovy 0.44 % +0.1 %
24 down arrow Perl 0.43 % -0.0 %
25 down arrow Julia 0.39 % +0.0 %
26 up arrow Haskell 0.29 % +0.1 %
27 down arrow Cobol 0.29 % -0.0 %

Source : https://pypl.github.io/PYPL.html

TIOBE Index for April 2022

Apr 2022 Apr 2021 Change Programming Language Ratings Change
1 3 up arrow Python 13.92% +2.88%
2 1 down arrow C 12.71% -1.61%
3 2 down arrow Java 10.82% -0.41%
4 4 C++ 8.28% +1.14%
5 5 C# 6.82% +1.14%
6 6 Visual Basic 5.40% +0.85%
7 7 JavaScript 2.41% -0.03%
8 8 Assembly language 2.35% +0.03%
9 10 up arrow SQL 2.28% +0.45%
10 9 down arrow PHP 1.64% -0.19%
11 16 up arrow R 1.55% +0.44%
12 12 Delphi/Object Pascal 1.18% -0.29%
13 14 up arrow Go 1.09% -0.14%
14 15 up arrow Swift 1.00% -0.19%
15 13 down arrow Ruby 0.88% -0.35%
16 11 down arrow Classic Visual Basic 0.83% -0.71%
17 23 up arrow Objective-C 0.82% +0.15%
18 18 Perl 0.79% -0.21%
19 37 up arrow Lua 0.78% +0.45%
20 19 down arrow MATLAB 0.74% -0.25%

Source : https://www.tiobe.com/tiobe-index/

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



Share this Tutorial / Exercise on : Facebook and Twitter

Python: Tips of the Day

What will this strange dict expression evaluate to?

Example:

print({True: 'yes', 1: 'no', 1.0: 'Tips'})

Output:

{True: 'Tips'}