Signed up recently but had issues with the confirmation email?
Click Forgot password and follow the reset steps. You can choose the same password you used when you signed up. This should then provide access.
Remember to check Spam and Junk. The email will be from auth@progressbytes.co.uk.
301.16 Defensive Design
Practise exam questionsDefensive Design — Note 4 of 5
Reusable validation routines.
Writing validation as a function makes it reusable. A validation function takes input, checks it, and either returns the valid value or keeps asking until it's correct.
def get_int_in_range(prompt, low, high):
value = int(input(prompt))
while value < low or value > high:
print("Must be " + str(low) + "-" + str(high))
value = int(input(prompt))
return value
age = get_int_in_range("Age: ", 0, 120)Specification notes for programming are in Paper 2.