[Python-Help] Programming help
Abe Mathews
59bassman at gmail.com
Sun Dec 5 21:35:00 EST 2004
I guess I don't understand what "freq" is doing. However, you could
do something like:
num_list = []
while len(num_list) < count:
number = input("Enter a number:")
num_list.append(number)
print num_list
That may give you what you're looking for to print the list of input numbers.
Abe Mathews
On Mon, 6 Dec 2004 12:07:58 +1000, Alfred Canoy <alred at guam.net> wrote:
> Please help me out:(.. I've been trying to figure this out for 2 days now..
> I don't know what to use to print all the list of numbers. I hve know idea
> how should I do this. I tried a lot of trial & error for the the def, dict,
> .list( ). have no luck.
> I just need to find this out then I'm good to go for the whole thing. I have
> save the other test source code for this problem. I just need to combine it
> after I figure this out.
> Thank you all!
>
>
>
>
> 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] ?"
>
> Al
> _ _
> _ _
> Alfred Canoy
> Agana, Guam
> Pacific time
> alred at guam.net
>
> ----- Original Message -----
> From: "Matthew Dixon Cowles" <matt at mondoinfo.com>
> To: "Alfred Canoy" <alred at guam.net>
> Cc: <help at python.org>
> Sent: Monday, December 06, 2004 11:50 AM
> Subject: Re: [Python-Help] Programming help
>
> > Dear Alfred,
> >
> >> 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?
> >
> > What have you tried and how did the results differ from what you
> > expected?
> >
> > Regards,
> > Matt
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
More information about the Python-list
mailing list