Skip to content
Solution Debug 4.3. Total Points
  • Pages
    • icon picker
      Solution
    • The Task
    • Python Starter Code
    • CodeClips

Solution

At the right hand side is the the task, starter code and code clips that pupils got.
Below is a link to the solution. You can right click open on replit to demo the answer to pupils and talk through the code.
solution
# prints a blank line
print('\n')

# set total to 0
total = 0

# ask user for first event points and stores user input
eventOne = int(input('Enter the first event points: '))

# add next points
total = total + eventOne;
# ask user for second event points and stores user input
eventTwo = int(input('Enter the second event points: '))

# add next points
total = total + eventTwo;

# ask user for third event points and stores user input
eventThree = int(input('Enter the third event points: '))

# add next points
total = total + eventThree;

# ask user for fourth event points and stores user input
eventFour = int(input('Enter the fourth event points: '))

# add next points
total = total + eventFour;

# ask user for fifth event points and stores user input
eventFive = int(input('Enter the fifth event points: '))

# add next points
total = total + eventFive;

# prints a blank line
print('\n\n')
# display total number
print(str(eventOne) + " + " + str(eventTwo) + " + " + str(eventThree) + " + " + str(eventFour) + " + " + str(eventFive) + " = " + str(total));

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