[Tutor] Python trouble

Nathan Clark 261100nc at gmail.com
Tue Dec 29 11:52:24 EST 2015


This is a  fibonnaci sequence generator, the colon causes a syntax error


#set variables
num_1 = 1
num_2 = 2
count = 0
terms = int(input("How many terms of the fibonnaci sequence would you
like?")


#function
while terms != count :
    num_3 =num_1+num_2
    print (num_3)
    num_1=num_2
    num_2 = num_3
    count=count+1
else:
    print ("finished")


More information about the Tutor mailing list