Lesson 4 of 16
Lesson Progress: 0%
Code Example
# Integer variables
age = 10
score = 25
# Decimal variables
price = 2.5
height = 4.2
# String variables
name = "Sam"
message = "Hello"Instructions
▼ ← Click the triangle to hide or reveal instructions.Python Code Editor
Task Incomplete
Editor Input:
Editor Output:
=.= sign assigns a value into the variable.age = 10 stores the number 10 in a variable called age.score = 25 stores the number 25 in score.price = 2.5 stores a decimal number.height = 4.2 stores another decimal number." ".name = "Sam" stores the word Sam.message = "Hello" stores the word Hello.Code Example
# Addition with variables
a = 5
b = 2
print(a + b)
# Subtraction with variables
x = 8
y = 3
print(x - y)
# Multiplication with variables
m = 4
n = 2
print(m * n)
# Division with variables
p = 10
q = 5
print(p / q)Instructions
▼ ← Click the triangle to hide or reveal instructions.Python Code Editor
Task Incomplete
Editor Input:
Editor Output: