Oct-15-2019, 08:43 PM
You can do it with a very little change in the code
import ast n = ast.literal_eval(input("What term of the Fibonacci Sequence would you like to know? ")) if type(n) != int: raise TypeError("n must be a positive integer") if n < 1: raise ValueError("n must be a positive integer")