Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

40 строки
1.3 KiB
Python

Python 3.13.7 (tags/v3.13.7:bcee1c3, Aug 14 2025, 14:15:11) [MSC v.1944 64 bit (AMD64)] on win32
Enter "help" below or click "Help" above for more information.
round(123.456,1)
123.5
round(123.456,0)
123.0
dir(round)
['__call__', '__class__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getstate__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__name__', '__ne__', '__new__', '__qualname__', '__reduce__', '__reduce_ex__', '__repr__', '__self__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__text_signature__']
type(123.5)
<class 'float'>
type(round(123.0)
)
<class 'int'>
type(round(123.456,1))
<class 'float'>
>>> type(round(123.456,0))
<class 'float'>
>>> type(123.0)
<class 'float'>
>>> round(123.456)
123
>>> type(123)
<class 'int'>
>>> gg=range(76,123,9)
>>> type(gg)
<class 'range'>
>>> list(gg)
[76, 85, 94, 103, 112, 121]
>>> range(23)
range(0, 23)
>>> qq="Снегура"
>>> qq=["Снегура", "Туровец", "Хатюхин", "Шабатов"]
>>> ff=zip(gg,qq)
>>> ff
<zip object at 0x00000203B0C7EF40>
>>> type(ff)
<class 'zip'>
>>> tuple(ff)
((76, 'Снегура'), (85, 'Туровец'), (94, 'Хатюхин'), (103, 'Шабатов'))