Your code has an error at the last print,i will check it further as soon as i go home
optimized the code a bit for my standards
optimized the code a bit for my standards
f=[1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] user_input = input() while user_input !='END': user_input = int(user_input) while type(user_input)==int: while len(f) < user_input: f.append(sum(f[-2:])) print (f[user_input - 1]) user_input=input()