Python from Beginner to Advanced.pdf
(
2218 KB
)
Pobierz
Python from Beginner to Advanced
This Python e-book will help you understand all the vital elements of the Python programming language. Anyone who
wants to learn Python without any prior experience in programming and anyone who wants to refresh their Python
knowledge can read this e-book and get a grip on widely used Python concepts.
1. Introduction to Python
Starting with Python
After reading this Python e-book, the you will be able to write programs in Python, use any Python libraries and develop
their own packages using Python.
The first step in learning any programming language is to set up the environment for writing programs. As we are going
through a Python e-book, we will start with installing Python in three different OS platforms.
Python Installation
To check if Python is already installed, follow the below-mentioned steps.
•
•
Press Windows + r to get the run.
Then type cmd and press enter.
•
After opening the cmd. you can check if Python is already installed by using typing Python into the cmd.
4
We can also check the version of Python installed by using commands as demonstrated below.
Now we will walk through on how to install Python in Windows. Links are provided for quick navigation when following the
e-book. From the Python for Windows weblink, the stable version of Python can be downloaded with your choice between
64 bit or 32-bit Operating system versions.
5
Kup książkę
As we can see, the latest release available for Python 3 is Python 3.10.0. Now click on the Latest Python 3 Release –
Python 3.10.0 and it will navigate you to the downloader’s page where if we scroll down to the bottom of the page, we will
find a table as below.
Now click on the Windows Installer (32-bit) or Windows Installer (64-bit) according to your desire. A window will open
asking you to select the path where you want to download your installer. After downloading the executable file, double-
click on the file to start the installation.
Below you can find the steps.
•
•
•
•
Run the Python executable file, in our case it will be Python-3.10.0.exe.
When you double-click on the file, a window will open asking do you want to run this file. Click on run to start the
Python installation.
According to your choice select if you want Python to be installed for all users or for a single user.
Also, select add Python 3.10 to PATH check box.
6
Kup książkę
•
•
•
•
Then select install now. Install now will install Python with all recommended settings which is a good option
for beginners.
Then it will take few minutes for the setup to complete, and you will be taken to next dialog prompt which will ask you
to disable the path length limit. This will allow the Python to use long path names without any character
limit of 260 which is enabled if the path length limit is not disabled.
To verify if Python is installed, you can use the Python -V or Python –version or just type Python in the cmd.
Congratulations, you have successfully installed Python. Let’s write our first program in cmd using Python.
•
•
•
•
•
In our first program we will just print “Congratulations!, you have installed Python correctly”.
To write this, we will use print function of Python.
Type print(“Congratulations!!, you have installed Python correctly”).
Then press enter.
You will see that the statement we wrote inside the print as displayed below.
Introduction to Python
Python is an interpreted high-level dynamically typed object-oriented programming language.
Before delving into writing programs in Python, it’s important to understand what the above terms mean.
High Level Language
A high-level language gives the programmer freedom to code programs which are independent of a particular type of
device. They are called high level languages as they are closer to human languages. Python is high level because it is not a
compiled language, Python requires another program to run the code unlike C which run directly on local processor.
7
Kup książkę
Interpreted Language
Python is an interpreted language, as the Python program’s source code is converted into byte code that is then executed
in the Python virtual machine, unlike C or C++.
Dynamically Typed Language
Python is a dynamically typed language because the type of the variable is checked during run time. We will learn about
data types in the following chapters.
Object-Oriented Language
Python is an object-oriented language because the Python developer can use classes and objects to write clean and
reusable code.
Advantages and disadvantages of using Python
Advantages of using Python
•
•
•
•
•
•
As Python syntaxes are closer to human language, it is easier to learn, understand and write the code.
It is both functional and objected-oriented language.
Python has a large community support and also it has a large number of modules, libraries and packages.
Due to its simplicity, developing a Python program or application faster than developing in any other language like
Java.
Python is a choice of language in data science, machine learning and artificial intelligence due to its wide variety of
machine learning packages and libraries.
Almost everything can be developed using Python, it also has tools for app development such as kivy, flask, Django
and many others.
8
Kup książkę
Plik z chomika:
VirtualTomes
Inne pliki z tego folderu:
Algorytmy Data Science. Siedmiodniowy przewodnik. Wydanie II.pdf
(4601 KB)
40 algorytmów, które powinien znać każdy programista. Nauka implementacji algorytmów w Pythonie.pdf
(4108 KB)
Black Hat Python. Język Python dla hakerów i pentesterów. Wydanie II.pdf
(6101 KB)
Algorytmy dla bystrzaków.pdf
(2441 KB)
Architektura aplikacji w Pythonie. TDD, DDD i rozwój mikrousług reaktywnych.pdf
(2453 KB)
Inne foldery tego chomika:
!
3ds max
Access
Acrobat
After Effects
Zgłoś jeśli
naruszono regulamin