Ma’lumot tipini aniqlash
Ma’lumot tipini aniqlash
type() funksiyasi yordamida istalgan obyektning ma’lumot tipini aniqlashingiz mumkin:
Python’dagi barcha o‘rnatilgan ma’lumot tiplari:
Misol
print(type("Hello"))
print(type(3))
print(type(3.14))
print(type(1j))
print(type(["apple", "banana", "cherry"]))
print(type(("apple", "banana", "cherry")))
print(type(range(6)))
print(type({"name" : "John", "age" : 36}))
print(type({"apple", "banana", "cherry"}))
print(type(frozenset({"apple", "banana", "cherry"})))
print(type(True))
print(type(b"Hello"))
print(type(bytearray(5)))
print(type(memoryview(bytes(5))))
O‘zingiz sinab ko‘ring »
W3Schools Pathfinder
Yutuqlaringizni kuzating – bu bepul!
