# checks for an integer between 5 and 20 def int_checker(to_check, low, high): while True: error = f"Please enter an integer that is between {low} and {high}." try: response = int(to_check) # checks that the number is equal or more if low <= response <= high: return response else: print(error) return "invalid" except ValueError: print(error) return "invalid" # Automated testing is below in the form (test_case, expected_value) to_test = [ ("xlii", "invalid"), ("0.5", "invalid"), ("4", "invalid"), ("21", "invalid"), (5,5), (20,20), ] for item in to_test: # retrieve test case and expected value case = item[0] expected = item[1] # get actual value (ie: test ticket function) actual = int_checker(case, 5, 20) # compare actual and expected and output pass / fail if actual == expected: print(f" ✅✅✅Passed! Case: {case}, expected: {expected}, received: {actual} ✅✅✅") else: print(f"❌❌❌ Failed! Case: {case}, expected: {expected}, received: {actual} ❌❌❌")