[Courses] [python] Lesson 2: Loops, if, and beer

Ivan Avery Frey ivan.avery.frey at gmail.com
Sat Jun 25 15:33:06 UTC 2011


On 25/06/11 10:20, Erin McLaughlin wrote:
for i in range(99, 0, -1) :
    if i < 3 :
        bottle = "bottle"
    else :
        bottle = "bottles"

    print i, bottle, "of beer on the wall,"
    print i, bottle, "of beer"
    print "Take one down, pass it around,"
    if i == 1 :
        print "No bottles of beer on the wall."
    else :
        print i-1, bottle, "of beer on the wall.\n"
------------------------------------------------------------

What happens when i is 2?

Ivan.



More information about the Courses mailing list