Skip to content
Solution Triathlon
  • Pages
    • Solution
    • 01-The Task
    • pseudocode
    • 02-stage 1
    • 03-stage 2
    • 04-stage 3
    • 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.
# INPUT DATA

# prompt for swim points, get keyboard input
swimPoints = int(input('Enter swimming points: '))
# prompt for cycling points, get keyboard input
cyclePoints = int(input('Enter cycling points: '))
# prompt for ???


# PROCESS DATA
# set totalPoints to points for swim add cycle add run
totalPoints = swimPoints + cyclePoints

# OUTPUT DATA
# display message with totalPoints
print('Swim, cycle, run total: ' + str(totalPoints))


Below is a link to the starter task. You can right click open on replit to demo the answer to pupils and talk through the code.

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