def var python code example Example 1: variables in python x = 5 y = "John" print(x) print(y) Example 2: declare float python myfloat = 7.0