On 25/08/11 10:46, Lisi wrote:
I copied and ran the following script:

multiplier = 12

for j in range(1,13):
     print "%d x %d = %d" %(j, multiplier, j*multiplier)

That ran perfectly and gave me the 12 times table.

I then decided that it would be fun to branch out and make teh
script "universal", so I wrote and ran:

print "Which times table do you want?"

multiplier = raw_input ()

I seem to recognise that code :-)

You will find if you fast-forward to the "talking to the user" topic that we revisit the multiplication table doing exactly this. You will find out what is missing there. :-)

HTH,

--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to