Drop hier links of afbeeldingen om ze aan de editor toe te voegen.

In a make task you use the skills you have learned to create a program from scratch. There is no starter code: you begin with an empty editor.

Your task

Write a program called Test Grader.

Ask the question with its own print, exactly as written:

Enter a test mark between 1 and 100:

The question and the four messages are all part of the checked output, and are checked exactly as they are written here:

Enter a test mark between 1 and 100:
That mark is too low
That mark is too high
Retake required
Well done, you passed

Marks are whole numbers, so use int() on the input and never float().

The program carries on after a range message, so a mark of 0 gets both That mark is too low and Retake required, and a mark of 101 gets both That mark is too high and Well done, you passed. Nothing tells the program to stop, and none of the checks after the range check knows that the mark was out of range: as far as the fail check is concerned, 101 is not less than 40, so it counts as a pass, exactly like 75 does.

A mark that is inside the range and is a pass gets Well done, you passed. Neither range message applies, and fail holds N, so the retake check is false and its else branch runs instead. Selection with two outcomes always runs exactly one of its branches, so every mark produces some output.

Example

A mark just below the pass mark:

Input:

39

Output:

Enter a test mark between 1 and 100:
Retake required

A mark below the allowed range:

Input:

0

Output:

Enter a test mark between 1 and 100:
That mark is too low
Retake required

A comfortable pass:

Input:

75

Output:

Enter a test mark between 1 and 100:
Well done, you passed

75 is inside the allowed range, so neither range message applies, and it is a pass, so the else branch of the retake check runs instead of the if.


A mark above the allowed range:

Input:

101

Output:

Enter a test mark between 1 and 100:
That mark is too high
Well done, you passed

101 triggers the too-high message, but the fail check only asks whether the mark is less than 40, so 101 still counts as a pass and gets Well done, you passed as well.

Help! My code doesn't work!

Make sure that you check for the following things:

  • There is a colon (:) at the end of every if line and every else line.
  • Every line inside a branch is indented, and all of them by the same amount. Never mix tabs and spaces in one file.
  • There is no condition after else.
  • You have used a double equals (==) in a condition that checks whether two pieces of data are the same, and != to check that they are different. A single = stores data in a variable.
  • The values stored in fail are the letters Y and N inside speech marks, not variable names.
  • You have checked the boundaries. A mark of exactly 40 is a pass, and a mark of exactly 1 or exactly 100 is inside the allowed range.
  • You have remembered the brackets after input, and the second closing bracket that int(input()) needs.