diff --git a/less1.md b/less1.md index 69cda8d..818a669 100644 --- a/less1.md +++ b/less1.md @@ -1,6 +1,7 @@ -Ссылка на урок: https://youtu.be/eRCv8uppabQ?si=u38RswCiFMWLosLv +[Ссылка на урок](https://youtu.be/eRCv8uppabQ?si=u38RswCiFMWLosLv) -Целые числа в Python +### Целые числа в Python ### +```python print(2 + 2) print(2 - 2) print(2 * 2) @@ -8,8 +9,10 @@ print(2 / 2) print("Остаток от деления", 3 % 2) print("Целая часть от деления", 9 // 4) print("Возведение в степень", 2 ** 4) +``` -Операции сравнения в Python +### Операции сравнения в Python ### +``` 1 > 1 1 < 1 1 <= 1 @@ -17,14 +20,18 @@ print("Возведение в степень", 2 ** 4) 1 != 1 1 == 1 1 < 2 < 3 +``` -Вещественные числа в Python +### Вещественные числа в Python ### +```python print(3 / 2) print(0.1) print(.1) print(.545456461218) +``` -Приведение типов в Python +### Приведение типов в Python ### +```python print(int(6.5)) print(float(6)) @@ -38,14 +45,19 @@ 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 ### +```python +product = "стол" +x, y, z = 1, 2, 3 +print(product, x, y, z) +``` -Типизация в Python +### Типизация в Python ### +```python print(type(product)) print(isinstance(product, int)) +``` [Назад на главную](readme.md) \ No newline at end of file