Senior
What data types do you know in Python?
sobes.tech AI
Answer from AI
Python has several basic data types:
- Numbers: int (integers), float (floating-point numbers), complex (complex numbers).
- Boolean type: bool (True/False).
- Sequences: str (strings), list (lists), tuple (tuples).
- Sets: set (set), frozenset (immutable set).
- Dictionaries: dict (associative arrays).
- NoneType: None (absence of value).
Example:
x = 10 # int
pi = 3.14 # float
name = "Anna" # str
flags = [True, False, True] # list of bool
config = {'host': 'localhost', 'port': 8080} # dict