python declare a string code example Example 1: variables in python x = 5 y = "John" print(x) print(y) Example 2: how to create a string in python var1 = "A String"