0 characters
4. Results of the section «Introductory Python lessons»
Lessons in the section «Introductory Python lessons»
In the previous lesson we figured out variables and comments in Python. You will meet them in any code. In this lesson, we will summarize the section "Introductory Python lessons".
A brief retelling of the section «Introductory Python lessons»
Our first acquaintance with Python began with the answer to the question "What is the use of Python?". So, what is it? In Python, you can:
- Immerse yourself in working with artificial intelligence and machine learning;
- Develop a robot;
- Develop a GUI (graphical interface);
- Develop a game;
- Develop a CAD application;
- Create various web scenarios;
- Work with FTP;
- Work with the network;
- Process text;
- Process images;
- Visualize data;
- Automate any actions on the computer;
- Programming mathematical and scientific calculations;
- Work with xml/html files;
- And a lot more.
In the lesson, we learned how to install everything you need and wrote the standard first program:
print("Hello World!")
In the next lesson we found out what variables are and derived some simple rules for working with them:
- when assigning a value to a variable, the data must be to the right of the variable;
- the variable name can start with a letter character or an underscore;
- to print a variable using the
print()
function, it must be written without quotes inside parentheses.
New information from the section «Introductory Python lessons»
Text output to the console using the print()
function:
print("Hello World!")
Entering data into the program using the input()
function:
a = input()
In Python, you can initialize several variables at once:
a, b, c = 1, 'Hello', [1, 2, 3]
Comments in Python can be single-line or multi-line:
# Comment
a = 2
b = 1 # variable b
'''
a comment
on
several lines
'''
a = 2
""" a comment
on
several lines """
a = 2
Conclusion
We have refreshed the memory of the section we have passed and go to to the next.
Test task
Subscribe to our Telegram channel!
News, useful material,
programming and InfoSec