codegurukool.com · Free coding tutorials & online compiler

Home › Python Tutorial › Python variables and output

Python variables and output

Names point to values; types can change.

You create a variable by assigning to it. There is no type keyword, and the type can change later. print shows values separated by spaces; type() tells you the type.

Example code

x = 5
name = "Ada"
print(name, x)
x = "now text"
print(x)
print(type(x))

Run this code in the online editor

← Python syntax and commentsPython data types, numbers and casting →