Search the courses, subjects, tracks, games and features, or jump straight to a page.
5 cards from this section. Quick, good the night before a test.
What is a SyntaxError?
Think about what happens if you write code incorrectly.
What does the try block do?
This block allows you to test code for errors.
What type of error occurs when you try to use a variable that hasn’t been defined?
Think about the name of the error.
True or False: A try block must always be followed by an except block.
Consider what else might follow a try.
Create a small console program that prompts users to input ages, handles format exceptions, and calculates the average age.
Consider using a list to collect valid entries before calculating the average.
Design a function that takes a list of numbers and computes their reciprocal, handling any potential division by zero.
What will you do if you encounter a zero in the list?
6 more questions in this section. Enroll free to practise them all.
Enroll free