In Python, the data type of a variable is determined dynamically at runtime based on the value assigned to it. Python is a dynamically typed language, which means you don’t need to explicitly declare the data type of a variable when you declare it. When you assign a value to a variable, Python evaluates the type of the value and associates that type with the variable. For example:
x = 10 # integer
y = 3.14 # float
name = “John” # string
is_valid = True # boolean
x = 10 # integer
x = “hello” # now x is a string