[Tutor] modification

alan.gauld@bt.com alan.gauld@bt.com
Mon, 20 Aug 2001 17:12:05 +0100


> num = raw_input ('What shall I count to? ')

reads a character string from the user and stores it in num

> counter = 0
> while counter <= num:

compares the integer valued 'counter' with the string 
valued 'num' convert num to an integer with:

num = int(num) 

before the while.

Or more simply but less efficiently:

while counter <= int(num):


Should fix it.,

Alan g