Predict the Output
Beginner · Predict the output · from Python Numbers: Integers, Floats, and Math You'll Actually Use
From the lesson: Python Numbers: Integers, Floats, and Math You'll Actually Use
You're splitting a restaurant bill with three friends. The total is $85. How much does each person owe? You grab your phone calculator, but a Python programmer just types 85 / 4 and gets the answer instantly.
Read the lessonWithout running the code, predict what each line will print. Write your predictions as comments, then run the code to check.
print(10 // 3) # Your prediction:
print(10 % 3) # Your prediction:
print(2 ** 4) # Your prediction:
print(15 // 4) # Your prediction:
print(15 % 4) # Your prediction:
print(type(10 / 2)) # Your prediction:
More Numbers exercises
- Calculate the Total CostBeginner
- Even or Odd CheckerBeginner
- Fix the Bug: Wrong DivisionBeginner
- Fahrenheit to Celsius ConverterBeginner
- Compound Interest CalculatorBeginner
All Python exercises · 50 practice problems · Python Fundamentals quiz