Добавить less1.md

This commit is contained in:
parent dc6735182f
commit f6d48382a4
1 changed files with 49 additions and 0 deletions

49
less1.md Normal file
View File

@ -0,0 +1,49 @@
Ссылка на урок: https://youtu.be/eRCv8uppabQ?si=u38RswCiFMWLosLv
Целые числа в Python
print(2 + 2)
print(2 - 2)
print(2 * 2)
print(2 / 2)
print("Остаток от деления", 3 % 2)
print("Целая часть от деления", 9 // 4)
print("Возведение в степень", 2 ** 4)
Операции сравнения в Python
1 > 1
1 < 1
1 <= 1
1 >= 1
1 != 1
1 == 1
1 < 2 < 3
Вещественные числа в Python
print(3 / 2)
print(0.1)
print(.1)
print(.545456461218)
Приведение типов в Python
print(int(6.5))
print(float(6))
str_1 = "это строка 1"
str_2 = 'это строка 2'
print(str_1 + str_2)
print(str_1 * 3)
print(str_1 == str_2)
print(str_1[0])
print(str_1[0:3])
print(str_1[-1])
print(len(str_1))
Переменные в Python
product = "стол"
x, y, z = 1, 2, 3
print(product, x, y, z)
Типизация в Python
print(type(product))
print(isinstance(product, int))