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!

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, Oct 2021 compared to a year ago:

`
Rank Change Language Share Trend
1 Python 29.66 % -2.1 %
2 Java 17.18 % +0.8 %
3 Javascript 8.81 % +0.4 %
4 C# 7.3 % +1.1%
5 C/C++ 6.48 % +0.7 %
6 PHP 5.92 % +0.1 %
7 R 4.09 % +0.2 %
8 Objective-C 2.24 % -1.2 %
9 up arrow TypeScript 1.91 % +0.1 %
10 up arrow Kotlin 1.9 % +0.3 %
11 down arrow Swift1.86% -0.6 %
12 down arrow Matlab 1.58 % -0.2 %
13   Go 1.49 % +0.1 %
14 VBA 1.33 % +0.1 %
15 Ruby 1.09 % -0.0 %
16 Rust 1.08 % -0.0 %
17 up arrow Ada 0.92 % +0.3 %
18 Visual Basic 0.75 % +0.1 %
19 down arrow Scala 0.73 % -0.1 %
20 up arrow Abap 0.63 % +0.2 %
21 down arrow Dart 0.6 % +0.0%
22 down arrow Lua 0.54 % -0.0 %
23 up arrow Julia 0.48 % +0.1 %
24 up arrow Groovy 0.47 % +0.1 %
25 down arrow Cobol 0.4 % -0.0 %
26 down arrow Perl 0.37 % -0.1 %
27 up arrow Delphi/Pascal 0.2 % -0.0 %
28 down arrow Haskell 0.0 % -0.3 %

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

TIOBE Index for October 2021

Oct 2021 Oct 2020 Change Programming Language Ratings Change
1 3 up arrow Python 11.27% -0.00%
2 1 down arrow C 11.16% -5.79%
3 2 down arrow Java 10.46% -2.11%
4 4 C++ 7.50% +0.57%
5 5 C# 5.26% +1.10%
6 6 Visual Basic 5.24% +1.27%
7 7 JavaScript 2.19% +0.05%
8 10 up arrow SQL 2.17% +0.61%
9 8 down arrow PHP 2.10% +0.01%
10 17 up arrow Assembly language 2.06% +0.99%
11 19 up arrow Classic Visual Basic 1.83% +1.06%
12 14 up arrow Go 1.28% +0.13%
13 15 up arrow MATLAB 1.20% +0.08%
14 9 down arrow R 1.20% -0.79%
15 12 down arrow Groovy 1.18% -0.05%
16 13 down arrow Ruby 1.12% -0.05%
17 16 down arrow Swift 1.11% +0.02%
18 37 up arrow Fortan 1.08% +0.70%
19 11 down arrow Perl 0.93% -0.49%
20 22 up arrow Delphi/Object Pascal 0.93% +0.22%

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



Python: Tips of the Day

List comprehension with the current and previous value:

>>> a = [1, 2, 4,2]
>>> [y - x for x,y in zip(a,a[1:])]
[1, 2, -2]