I have written this piece of code that finds all Fibonacci numbers that are less than a given number, but when I give a number like 1 million for the given number, my computer just hangs up. is there a way to fix this?
num_limit = int(input('pls enter the number limit: '))
fibbonacci_nums_list = []
x=0
y=x+1
for i in range(1,(num_limit + 1)):
fibbonacci_nums_list.append(x)
fibbonacci_nums_list.append(y)
x=x+y
y=y+x
for i in range(len(fibbonacci_nums_list)):
if fibbonacci_nums_list[-1] >= num_limit:
fibbonacci_nums_list.pop(-1)
print('the fibbonacci nums less than', num_limit, 'are', str(fibbonacci_nums_list))