Re: [Tutor] User Input List and Sort

2007-02-14 Thread Rikard Bosnjakovic
On 2/14/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Every example of a list that I've seen involves working with, sorting, etc > pre-populated list. How can I create a list where the user inputs a string > of numbers and then sorts it? The code of yours gets a commaseparated _string_, whi

[Tutor] User Input List and Sort

2007-02-14 Thread [EMAIL PROTECTED]
Every example of a list that I've seen involves working with, sorting, etc pre-populated list. How can I create a list where the user inputs a string of numbers and then sorts it? I've tried: print "Input list separated by commas" lst=[raw_input()] print lst print len(lst) lst.sort() print lst