Variable Examples

Example 1

Assign the variable name to your name. Print your name.

name = "Sandy"
print(name)

Example 2

Assign the variable age to your age. Print your age.

age = 14
print(age)

Example 3

Assign the variable bill to how much your phone bill is. Print the bill.

bill = 19.99
print(bill)

Example 4

Assign the variable adjective to blue. Assign the variable noun to sky. Using string concatenation, print both variables at the same time.

adjective = "blue"
noun = "sky"
print(adjective .. noun)