Python Introduction
What is Python?
Python is one of the most widely used programming languages. Guido van Rossum created it, and it was published in 1991.
It is used for :
- web development (server-side),
- software development,
- mathematics,
- system scripting.
What can Python do?
- Python will be used to construct web applications on a server.
- In order to construct workflows, Python can be used together with applications.
- Python has the ability to connect to database systems. It also has the ability to read and change files.
- Python can be used for managing large data and doing difficult maths.
- It is possible to utilise Python for quick prototype or for the creation of productive software.
Why Python?
- Python may be used on a variety of platforms (Windows, Mac, Linux, Raspberry Pi, etc).
- Python will have an English language-like easy syntax.
- Python offers a syntax that lets developers construct less-line programmes than certain other languages.
- Python is running on an interpreter system, which means that code can be executed when written. Prototyping may therefore be quite rapid.
- Python can be approached in three ways: procedural, object-oriented, and functional.
Good to know
- Python 3, which we will use in this course, is the most recent major version of Python. Python 2, on the other hand, is still highly popular, despite the fact that it is only updated with security upgrades.
- Python is typed to a text editor in this tutorial. In an integrated development environment like Thonne, Pycharm, Netbeans or Eclipse, Python may be written that is especially beneficial for the administration of huge python file collections.
Related Links
Python Syntax compared to other programming languages
- Python has been intended for reading and has certain similarities to the English language with mathematical impact.
- In contrast to other programming languages, Python employs new lines to complete a command, rather than semicolons or parentheses.
- To determine the scope of the loops and functions, Python uses indentation and whitspaces, to determine the scope. Curly brackets are widely used for such purpose by other computer languages.
Example :-
print("Hello, World!")
Output :-
Python Install
Python will be pre-installed on many PCs and Macs.
To see if you have python installed on your Windows PC, type "python" into the search box in the start menu, or type the following into the Command Line (cmd.exe) :
C:\Users\Your Name>python --version
To check that you've installed python on Linux or Mac, then open the Terminal on Linux or Mac and type.
python --version
You may get the python from the following website https://www.python.org/ without any charge.
Related Links
Python Quickstart
This implies as a developer you've written Python (.py
) files into a
text editor and then have them in the interpreter to perform.
Python is an interpreted programming language.
This is how you launch a python file from the command line :
C:\Users\Your Name>python helloworld.py
The name of your Python file is "helloworld.py".
Let's start by creating our initial Python file, helloworld.py, which may be performed in every text editor.
helloworld.py
print("Hello, World!")
Output :-
As easy with that. Saving your file. Go to a folder where you have saved your file, open your command line and execute.
C:\Users\Your Name>python helloworld.py
The output should read :
You've successfully written and run your first Python program.
The Python Command Line
It's sometimes easy and quickest never to write code in a file to check a little bit of code in Python. This is because Python can run itself as a control line. This is conceivable.
On a command line on Windows, Mac OS X, or Linux, type the following :
C:\Users\Your Name>python
You can also try "py" if the "python" command doesn't work :
C:\Users\Your Name>py
You could write every python there, including our world scenario from the beginning of the tutorial :
E:\>python
Python 3.9.6 (tags/v3.9.6:db3ff76, Jun 28 2021, 15:26:21) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
"Hello, World!" will be written in the command line as a result of this :
E:\>python
Python 3.9.6 (tags/v3.9.6:db3ff76, Jun 28 2021, 15:26:21) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> print("Hello, World!")
Hello, World!
Whenever you've finished in python, type as follows to exit the python command line interface.
exit()