[Tutor] Frustrated Beginner
R. Alan Monroe
amonroe at columbus.rr.com
Wed Sep 28 23:48:08 CEST 2005
> I am trying to learn Python to use in my lesson plans. I am using Windows XP
> and the textbooks I am using are Beginning Python by WROX and Learning
> Pyhton by O'Reilly.
> I am definning a range of words 0 to 55, if the number is divisible by
> 3,7,11 with no remainder print eggs, else print spam. This works.
> def firstpart():
> for n in range(0, 55):
> if n % 3 == 0 or n % 7 == 0 or n % 11 == 0:
> print 'eggs,',
> else:
> print 'spam,',
> # Now I am trying to modify the function to replace eggs with toast and spam
> with jelly. I have spent days and nothing works. Can you send me in the
> right direction??
It seems like you could just backspace the old words and type the new
words in their place. Unless I misundertand the purpose of the
program.
Alan
More information about the Tutor
mailing list