Skip to content
Calculations with starter code
  • Pages
    • The Task
    • icon picker
      Python Starter Code
    • Code Clips

Python Starter Code

Copy and paste the code below into your main.py file before you begin the task.

# Calculation
# prompt for first number
# get numberOne from keyboard
numberOne = int(input('Please enter the first number: '))

# prompt for second number
# get numberTwo from keyboard
numberTwo = int(input('Please enter the second number: '))

# set additionAnswer to numberOne **add** numberTwo

# set subtractionAnswer to numberOne **minus** numberTwo
# set multiplyAnswer to numberOne **multiplied** by numberTwo*

# set divisionAnswer to numberOne **divided** by numberTwo*

# display message with numberOne, numberTwo and additionAnswer
print(numberOne , '+' , numberTwo, '=' , additionAnswer)

# display message with numberOne, numberTwo and subtractionAnswer

#display message with numberOne, numberTwo and **multiplyAnswer***


#display message with numberOne, numberTwo and **divisionAnswer***

 
Want to print your doc?
This is not the way.
Try clicking the ··· in the right corner or using a keyboard shortcut (
CtrlP
) instead.