I wrote this code, which I found in the book 'Python for dummies'
countdown = 10
while countdown:
print countdown,
countdown -= 1
print "Blastoff!"
It should print 10 9 8 7 6 5 4 3 2 1 Blastoff!
When I run the program, I get an error 'Missing parentheses in call to print'
On youtube I found a code similar to this, which counts from 0 to 10000000. This one works just fine.
def count(x):
while (x <= 10000000):
print (x)
x+=1
count(0)
print ("I hate my job. I quit!")
How comes they look so different? What kind of basic knowledge do I need to understand this? Is this a question of different python versions? Is 'Python for dummies' a bad book?