Обновить less1.md
This commit is contained in:
parent
bcaa0a47b9
commit
96c637be9a
26
less1.md
26
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)
|
print(2 - 2)
|
||||||
print(2 * 2)
|
print(2 * 2)
|
||||||
|
@ -8,8 +9,10 @@ print(2 / 2)
|
||||||
print("Остаток от деления", 3 % 2)
|
print("Остаток от деления", 3 % 2)
|
||||||
print("Целая часть от деления", 9 // 4)
|
print("Целая часть от деления", 9 // 4)
|
||||||
print("Возведение в степень", 2 ** 4)
|
print("Возведение в степень", 2 ** 4)
|
||||||
|
```
|
||||||
|
|
||||||
Операции сравнения в Python
|
### Операции сравнения в Python ###
|
||||||
|
```
|
||||||
1 > 1
|
1 > 1
|
||||||
1 < 1
|
1 < 1
|
||||||
1 <= 1
|
1 <= 1
|
||||||
|
@ -17,14 +20,18 @@ print("Возведение в степень", 2 ** 4)
|
||||||
1 != 1
|
1 != 1
|
||||||
1 == 1
|
1 == 1
|
||||||
1 < 2 < 3
|
1 < 2 < 3
|
||||||
|
```
|
||||||
|
|
||||||
Вещественные числа в Python
|
### Вещественные числа в Python ###
|
||||||
|
```python
|
||||||
print(3 / 2)
|
print(3 / 2)
|
||||||
print(0.1)
|
print(0.1)
|
||||||
print(.1)
|
print(.1)
|
||||||
print(.545456461218)
|
print(.545456461218)
|
||||||
|
```
|
||||||
|
|
||||||
Приведение типов в Python
|
### Приведение типов в Python ###
|
||||||
|
```python
|
||||||
print(int(6.5))
|
print(int(6.5))
|
||||||
print(float(6))
|
print(float(6))
|
||||||
|
|
||||||
|
@ -38,14 +45,19 @@ print(str_1[0])
|
||||||
print(str_1[0:3])
|
print(str_1[0:3])
|
||||||
print(str_1[-1])
|
print(str_1[-1])
|
||||||
print(len(str_1))
|
print(len(str_1))
|
||||||
|
```
|
||||||
|
|
||||||
Переменные в Python
|
### Переменные в Python ###
|
||||||
|
```python
|
||||||
product = "стол"
|
product = "стол"
|
||||||
x, y, z = 1, 2, 3
|
x, y, z = 1, 2, 3
|
||||||
print(product, x, y, z)
|
print(product, x, y, z)
|
||||||
|
```
|
||||||
|
|
||||||
Типизация в Python
|
### Типизация в Python ###
|
||||||
|
```python
|
||||||
print(type(product))
|
print(type(product))
|
||||||
print(isinstance(product, int))
|
print(isinstance(product, int))
|
||||||
|
```
|
||||||
|
|
||||||
[Назад на главную](readme.md)
|
[Назад на главную](readme.md)
|
Loading…
Reference in New Issue