Programming help

Alfred Canoy alred at guam.net
Mon Dec 6 02:37:47 CET 2004


Hello,

I'm stuck in the end of my source code. I'm trying to print all the numbers. How can I print all the list of numbers that I selected? 

 
Source code:

# compute the Mean, Median & Mode of a list of numbers:

sum = 0.0

print 'This program will take several numbers then average them'
count = input(' How many numbers would you like to sum: ')
current_count = 0
freq = {}
freq [current_count] = number

while current_count < count:
    current_count = current_count + 1
    number = input ('Enter a number: ')
    print "Number", current_count,":",number
    sum = sum + number
print " [x,...,x] ?"

Output:

This program will take several numbers then average them
number 1:  2
number  2:  3
number  3:  4
number  4:  2

How can I print: [2,3,4,2]?

Greatly appreciates!
Al
 _ _
_ _
Alfred Canoy
Agana, Guam
Pacific time
alred at guam.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20041206/07b89f35/attachment.html>


More information about the Python-list mailing list