Lesson 3 of 16
Lesson Progress: 0%
print(5 + 2)
print(10 + 3)Instructions
▲ ← Click the triangle to hide or reveal instructions.Python Code Editor
Task Incomplete
Editor Input:
Editor Output:
+ means add.print(5 + 2) tells Python to add 5 and 2, then show the answer.print(10 + 3) does the same thing with 10 and 3, then prints the new answer.print(8 - 3)
print(10 - 4)Instructions
▲ ← Click the triangle to hide or reveal instructions.Python Code Editor
Task Incomplete
Editor Input:
Editor Output:
- means subtract.print(8 - 3) tells Python to take 3 away from 8 and show the answer.print(10 - 4) tells Python to take 4 away from 10 and print the answer.print(4 * 2)
print(3 * 3)Instructions
▲ ← Click the triangle to hide or reveal instructions.Python Code Editor
Task Incomplete
Editor Input:
Editor Output:
* sign in Python multiplies numbers together.print(4 * 2) tells Python to multiply 4 by 2 and show the answer.print(3 * 3) tells Python to multiply 3 by 3 and print the answer.print(10 / 5)
print(12 / 6)Instructions
▲ ← Click the triangle to hide or reveal instructions.Python Code Editor
Task Incomplete
Editor Input:
Editor Output:
/ sign in Python divides one number by another.print(10 / 5) tells Python to divide 10 by 5 and show the answer.print(12 / 6) tells Python to divide 12 by 6 and print the answer.print(10 % 3)
print(8 % 4)
print(7 % 5)Instructions
▲ ← Click the triangle to hide or reveal instructions.Python Code Editor
Task Incomplete
Editor Input:
Editor Output:
% sign in Python gives back the leftover part after dividing.print(10 % 3) shows the leftover after 10 is divided by 3.print(8 % 4) shows the leftover after 8 is divided by 4, which is 0.print(7 % 5) shows the leftover after 7 is divided by 5.number = 7
print(number % 2)
print(number % 2 == 0)
print(number % 2 == 1)Instructions
▲ ← Click the triangle to hide or reveal instructions.Python Code Editor
Task Incomplete
Editor Input:
Editor Output:
% sign in Python gives the leftover part after dividing.print(number % 2) shows the leftover when the number is divided by 2.print(number % 2 == 0) checks if the leftover is 0.print(number % 2 == 1) checks if the leftover is 1.number = 10
print(number % 2)
print(number % 2 == 0)
print(number % 2 == 1)Instructions
▲ ← Click the triangle to hide or reveal instructions.Python Code Editor
Task Incomplete
Editor Input:
Editor Output:
% sign in Python gives the leftover part after dividing.print(number % 2) shows the leftover when the number is divided by 2.print(number % 2 == 0) checks if the leftover is 0.print(number % 2 == 1) checks if the leftover is 1.Test Incomplete