Edit - All fixed thank you
fib=[0,1]
for i in range(0,700):
fib.append(fib[len(fib)-2]+fib[len(fib)-1])
print(fib[len(fib)-1])
print('Do you want a range of numbers or single?')
answer=input()
if answer=='single':
print('Which number?')
number=int(input())
fib[number]
elif answer=='range':
print('From:')
firstNumber=int(input())
print('To:')
secondNumber=int(input())
fib[firstNumber:secondNumber]
I have been trying to create a Fibonacci sequence in python which allows you to choose either which number to show or what range of numbers to show (script above). However when i run the script it runs fine at the start, i get to the part when you enter the number you want (either a single number, or the to and from numbers) but when i do nothing happens and the script ends. I am very new to python (coming from html and css, and i CBA right now to code this in HTML xD). Could anyone help me?
printworks, why don't you use it?printout the result offib[number]orfib[firstNumber:secondNumber]so it doesn't get displayed, instead it just gets calculated and then thrown out.