Please help - get average

Borman, Linda E LBorman at sjm.com
Tue Oct 26 13:49:08 EDT 2004


Hi , Im new to Python can you help.
Trying to create a program that  I can entered  only 10 random numbers, and
calculate the average of those numbers after executing a loop. Using for
loop.
 
 
Stumped
This is what I have so far.
 
# using for loop
number = 10
while number !=0 :
    number = input("Enter a number: ")
    count = number
    sum =  number
    for a in range (1):
        print sum 
        print "The average is: ", sum / count
    print "all Done"
 
Linda Borman
Senior - Documentation Specialist
St.Jude Medical, Daig Division
Direct Line (952) 352-9718   
EXT #218

 


***************************** 
This communication may contain information that is proprietary, privileged,
confidential or legally exempt from disclosure.  If you are not a named
addressee, you are notified that you are not authorized to read, print,
retain, copy or disseminate this communication without the consent of the
sender and that doing so may be unlawful. If you have received this
communication in error, please notify the sender via return e-mail and
delete it from your computer. Thank you. St. Jude Medical, Inc. 
*****************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20041026/9f119102/attachment.html>


More information about the Python-list mailing list