Variables¶
As already mentioned Python variables are typeless in the regard to not caring about which type gets assigned.
output = "Hello World"
print(output)
output = 1440
print(output)
You can also assign expressions to variables.
output = 24 * 60
print(output)
But actually if a value gets assigned variables have a type.
output = "Hello World"
print(output.upper())
output = 24 * 60
print(output.upper())
Output can be found here [1]
You can get the type of a variable by calling the type
function on the
variable.
output = "Hello World"
type(output)
output = 24 * 60
type(output)