EfremovSI 1 месяц назад
Родитель d8500b559d
Сommit 04ad8bddc1

@ -646,16 +646,12 @@ dic5
```
```py
tupl3 = ('N', 'I', 'G', 'G', 'E', 'R')
s = 's'
tupl3 = tupl3 + (s,)
tupl3
('N', 'I', 'G', 'G', 'E', 'R', 's')
l1st = ['R', 'U', 'S', 'I', 'A']
dict227 = dict(zip(l1st, tupl3))
tupl3 = ('A', 'B', 'C', 'D', 'E', 'F','G')
l1st = ['1', '2', '3', '4', '5']
dict227 = dict(zip(tupl3,l1st))
dict227
{'R': 'N', 'U': 'I', 'S': 'G', 'I': 'G', 'A': 'E'}
{'A': '1', 'B': '2', 'C': '3', 'D': '4', 'E': '5'}
len(dict227)
5 - элеменов получится пять, ведь команда zip работала столько раз, сколько элементов в наиболее маленьком объекте
```

@ -537,9 +537,10 @@ False
## 9. Методы.
Просмотрим список всех атрибутов объекта:
```py
>>> stroka='Микропроцессорная система управления';dir(stroka)
['__add__', '__class__', '__contains__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__getnewargs__', '__getstate__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__iter__', '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', 'capitalize', 'casefold', 'center', 'count', 'encode', 'endswith', 'expandtabs', 'find', 'format', 'format_map', 'index', 'isalnum', 'isalpha', 'isascii', 'isdecimal', 'isdigit', 'isidentifier', 'islower', 'isnumeric', 'isprintable', 'isspace', 'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'maketrans', 'partition', 'removeprefix', 'removesuffix', 'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title', 'translate', 'upper', 'zfill']
```
### 9.1. Методы в строках.

Загрузка…
Отмена
Сохранить