[Tutor] Python trouble

Alan Gauld alan.gauld at btinternet.com
Tue Dec 29 12:04:24 EST 2015


On 29/12/15 16:52, Nathan Clark wrote:
> This is a  fibonnaci sequence generator, the colon causes a syntax error


Please always post the full error text.
It contains much useful information.


> terms = int(input("How many terms of the fibonnaci sequence would you
> like?")

Count the parentheses...

> while terms != count :

The syntax error is marked against this line because is where
Python first finds something it can't recognise but the actual
error is further back. That's why, with syntax errors, you should
always check a line or two before the marked error point.
In particular always check for mis-matched quotes,
brackets/parens or indentation errors - these are the
most common mistakes.


-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Tutor mailing list