[Tutor] creating a dictionary for capital quiz program

Alan Gauld alan.gauld at btinternet.com
Tue Jun 2 17:38:08 CEST 2015


On 02/06/15 15:50, Stephanie Quiles wrote:
 > So basically, what I did wrong was the indentation?

Yes.
In Python indentation is all important.

When you write a for (or while) loop Python executes all the
indented code under the opening loop statement. When it sees
an unindented statement it reads that as the next line
to execute *after* the loop completes.


-- 
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