Utilizor
Contact Us

Python Variables

Storing data values.

Examples

Creating Variables

Assigning values to variables.

x = 5
y = "John"
print(x)
print(y)

Type Casting

Specifying the data type.

x = str(3)    # x will be '3'
y = int(3)    # y will be 3
z = float(3)  # z will be 3.0

Get Type

Checking the type of a variable.

x = 5
y = "John"
print(type(x))
print(type(y))

Test Your Knowledge

Python Quiz

No quiz available for this topic yet.