Python command list for beginners
This project is about how to start learning the Python programming language. At the bottom of the article is a command list that you can use as a cheat sheet. That’s why the article is called “Python command list for beginners”. But before you read the instructions, you first need to know what you can do with Python.
Python is not only used for web and software development, but also for data analysis and machine learning.
Python was designed with simplicity and clarity in mind.
Python was designed. Someone who knows English can still read the language with great difficulty and know what the code is about.
I sat down with the basics and watched various YouTube videos. From this playlist, I then created the Python command list for beginners. You can find this command list below the video. Below this list I have placed an SVG file, where the most important information from the whole video playlist is described.
Variables:
print = prints a specific message on the screen.
input = For entering data via the keyboard
int = returns an integer from a given object or converts a number in a given base into a decimal number
float = Numbers with decimal places
bool = A boolean expression is an expression that is either true or false, in
false, called True and False in Python.
Strings:
.upper = the whole text is capitalized
.find (“y”) = finds the number of letters e.g. y
.replace (“for”, “4”) = It replaces for in 4
Arithmetic Operators:
(10 / 3) = divided by
(10 // 3) = divided by but only shows the numbers before the decimal point
(10 % 3) = What percentage of
(10 ** 3) = 10 to the power of 3
Comparison Operators:
x = 10 = In Python you can determine a number and change it e.g. with x += 3
> = greater than
< = less than
>= = greater than or equal to
<= = less than or equal to
== = equal to
Logical Operators:
and = if both are correct
or = one answer must be correct
not = the answer is not correct
if:
if = is used, if this assertion is correct
elif = is used after “if”
else: = if no assertion is true
Repetitions:
while = While loop is used to execute a block of statements repeatedly
repeatedly until a certain condition is met.
List:
In the list, there are various parts. The first part is 0, the second is 1, the third is 2, and so on.
The last part is -1, the second-to-last part is -2, the third-to-last part is -3, and so forth.
When dealing with a list, always use a comma to separate items = ,
If you want to display only one part of the list = 0 (first part), 1 (second part) … -1 (last part) -2 (second-to-last part).
.append() = add a part to the end of the list within the parentheses ()
.insert() = add a part to the list | First, choose the position in the list, then what will be added
.remove() = delete a position in the list by specifying the index of the item to be removed
.clear() = the list will not be displayed
print(1 in numbers) | ‘in’ command = [numbers (the name of the list)] it’s a question: Is the number 1 in the list called ‘numbers’?