KS3 Puzzle 7 Challenge Python – subroutines

Code / algorithm aim

The program should setup the first question as a subroutine. The subroutine should ask the user what the capital city of France is. The program should check that the user enters Paris and if they do should tell the user they have the right answer and call the second question subroutine.

If the user does not enter Paris the user should be told that they are incorrect and should try again. The first question subroutine should be called again to start the question again.

The program should setup the second question as a subroutine. The subroutine should ask the user what the capital city of Germany is. The program should check that the user enters Berlin and if they do should tell the user they have the right answer.

If the user does not enter Berlin the user should be told that they are incorrect and should try again. The second question subroutine should be called again to start the question again.

Finally the quiz should be started by calling the first subroutine.

WAIT! You aren’t logged in.
By logging in you can earn CS points and keep track of what you have done. Do you want to:

Login    

Join Now



Instructions (click to view)

All the code that you need has been given below. Simply organise the code blocks into the correct order and indent where necessary (by dragging the code block to the right) so that the code follows the algorithm aim above.