Challenge 5

Open your previous challenge program where you tested a single exam result and printed the comment that matched.

Save a new version of the file and alter it so that it now asks the user to enter the exam result which will be a whole number between 0 and 100. It should print the value entered and the comment that matches.

Remember that the input function returns a string, but you need it to be an integer to compare to another integer. Otherwise you’ll see an error like this:

An error message from comparing a str to an int

Now if only there was a function that converted things to integers…

Report a Glow concern
Cookie policy  Privacy policy