First, click "Solve the Problem:" to see detailed instructions and useful information.
Second, try to code a solution to the problem using the embedded Python coding environment.
Third, if you are finding it difficult, you can click "Get Some Hints:" to see some tips to help you solve the problem. There is also music to help you focus midway down the page.
Finally, at the bottom of the page, there is an embedded Form where you can paste and upload your completed solution.
Once you have uploaded your code there will be a link to the solution at the end of the Form, so just like in the exam even if you can't entirely finish the solution, upload as much as you have been able to and you can then see the correct answer afterwards to see where (if anywhere) you went wrong.
First line - take the user's answer to the question 'how many letters are there in the alphabet', make sure it is cast as a whole number (an integer), and save it to a variable with a sensible name. Try this:
user_answer = int(input("How many letters are there in the alphabet? "))
Next line - let's create something to compare it to. The number of letters in the alphabet never changes (or, at least, it hasn't for a very long time...) so we can save it to a constant:
correct_answer = 26
Note - the value 26 is not in speech marks, as that would make Python think it was a string. Writing it just as a plain number like this automatically makes it an integer. Neat!
Line three - our if statement, and exactly equals comparison line. And underneath that (indented so that it only runs if it is true that the user's answer is an exact match for the correct answer) is our positive print statement:
if user_answer == correct answer:
print("You got it right! Yay you!")
Finally, let's cover what happens if they get it wrong. Our else line:
else:
print("That isn't right... I am worried that you don't know how many letters there are in the alphabet. Period 7 English for you!")