Spam * Spam = Spam spam spam spam
So, I’ve been under some pressure from certain people to start learning Python. Sam is learning his multiplication tables at school so what better way to start than by killing two parrots with two sharp flat ones and a bag of gravel (after HelloWorld.py that is)…
# TimesTable
# For Sam - Prompts for a name and a number.
# Prints out x times table
# A bit Noddy but you gotta start somewhere...
name = raw_input( "Hello, what's your name : " )
print "Hi", name,
number = raw_input( ", type a number : " )
print " "
print "The times table for ", number, "is : "
print " "
for i in range(1, 13):
print i, "x", number, "=", i * int(number)



May 6, 2008 at 2:41 pm
Fabulous!
May 6, 2008 at 2:50 pm
How many lines would that have taken in Java?
May 6, 2008 at 3:28 pm
Dunno, I’m only on page 236 of the design document for the RPG version.
May 16, 2008 at 1:34 pm
I feel I must stick up for my old friend RPG; you could write pretty much the same code on a 400 and get the same result, you could even do it without a display file.
It’s all just fashion, or more like the emperors new clothes; that Python code looks almost exactly the same as the Sinclair Basic I used to whack into my ZX81.
The real difference is that few people have an AS/400 in front of them, and even if someone did have a ZX81 in front of them it would be about as useless as it always was. But we have all got a computer attached to t’internet in front of us and thus the the lingua franca du jour is whatever is a) free and downloadable and b) cool.
Anyway, I want to learn the language called Boo - purely because I like the name. Is it any good?