Oct-06-2022, 08:33 PM
The values themselves have types, but the variables that refer to them do not. Python is dynamically typed, so a variable can refer to values of different types:
x = 1 # x refers to an integer x = "foo" # now x refers to a stringThere are type hints - see the typing module, though as per the note in the docs, these aren't enforced.