Friday, February 11, 2011

Friday

I was working on python3 and I was stuck in an example  that I couldn't  understand but after reading the tutorial several times.
Here whats the commands lines:

a = 0
while a < 10:
    a = a + 1
    if a > 5:
        print(a, ">", 5)
    elif a <= 7:
        print(a, "<=", 7)
    else:
        print("Neither test was true")

1 comment:

  1. The if ... elif ... else statement is Python's "conditional branching" statement. I need to talk to Andrew at the beginning of class on Monday, but after that I should walk through this with you and Carlos.

    ReplyDelete