DEV Community

Manzura07
Manzura07

Posted on

Data Type

revers() - bu funksiya biza kiritgan sonlarni teskarisiga o'girib beradi va ekranga chiqarib beradi.
list1 = [123,54,3654,32,777]
list1.reverse()
print(list1)

Setting the specific data tupe - maxsus ma'lumot turini o'rnatish
agar siz ma'lumotlar turini belgilamoqchi bo'lsangiz quyidagi konstruktor funksiyasidan foydalaning

                     misol uchun:
Enter fullscreen mode Exit fullscreen mode

x = str("hello world")
x = int(20)
x = float(2.5)
x = complex(1j)
x = list(("apple","banana","cherry"))
x = tuple(("apple", "banana","cherry"))
x = range(6) -- range
x = dict(name = "John", age = 35)
x = set(("apple","banana","cherry"))
x = frozenset(("apple","banana","cherry"))
x = bool(5)
x = bytes(5)
x = bytearray(5)
x = memoryview(bytes(5))"""

            Pythonda uchta raqamli tur mavjud:
Enter fullscreen mode Exit fullscreen mode

intejer - int - bu butun sonlar uchun
float - bu kasr sonlar uchun
complex - bu butun sonlar ishlatiladi

Top comments (0)