(problem_answer)
| 2 | import operator |
| 3 | |
| 4 | def errorHandle(problem_answer): |
| 5 | switch = False |
| 6 | validated_guess = 0.0 |
| 7 | while switch == False: |
| 8 | try: |
| 9 | validated_guess = float(input('Please enter a valid answer: ')) |
| 10 | if type(validated_guess) is float: |
| 11 | switch = True |
| 12 | break |
| 13 | except ValueError: |
| 14 | pass |
| 15 | return validated_guess |
| 16 | |
| 17 | def random_problem(): |
| 18 | operators = { |