Friday, February 18, 2011

Friday

Today I was working python lessons and I like this tutorial that help you to average a certain of number in this application I can put the many number. This is the application codes:

count = 0
usum = 0.0
number = 1

print("Enter 0 to exit the loop")
while number != 0:
    number = float(input("Enter a number: "))
    if number != 0:
        count = count + 1
        usum = usum + number
print("The average was:", usum / count)

I I don't understand why the exclamation (!) sing in the lines (while number != 0:) and (if number != 0:)

1 comment:

  1. != means "not equal"

    Henry, I want to ask for your help (and Carlos) in moving the Open Book Project site from XHTML 1.0 to HTML 5.

    Let's talk about that on Tuesday, but I would like to get it finished in the next few weeks.

    Thanks!

    ReplyDelete