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))
In questa pagina del sito puoi guardare il video online Python datatypes. Python code with example. Python Complete Course Video # 5 della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Guangshu Coder 29 dicembre 2022, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 27 volte e gli è piaciuto like spettatori. Buona visione!