Built-in Data Types
In programming, data type is an important concept.
Variables can store data of different types, and different types can do different things.
Python has the following data types built-in by default, in these categories:
Text Type: str
Numeric Types: int, float, complex
Sequence Types: list, tuple, range
Mapping Type: dict
Set Types: set, frozenset
Boolean Type: bool
Binary Types: bytes, bytearray, memoryview
None Type: NoneType
#python #coding #programming
Python datatypes
String
x = "Guangshu Coder"
print(type(x))
integer
x = 233
print(type(x))
Float
x = 3.1467
print(type(x))
complex
x = 2j
print(type(x))
list
x = ["apple", "Banana", "Orange"]
print(type(x))
tuple
x = ("apple", "Banana", "orange")
print(type(x))
range
x= range(54)
print(type(x))
dict
x= {"name": "Guangshu Coder", "age": 22}
print(type(x))
set
x = {"Guanghu", "coder", "programmer"}
print(type(x))
bool
x = False
print(type(x))
NoneType
x = None
print(type(x))
Sur cette page du site, vous pouvez voir la vidéo en ligne Python datatypes. Python code with example. Python Complete Course Video # 5 durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Guangshu Coder 29 décembre 2022, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 27 fois et il a aimé like téléspectateurs. Bon visionnage!