Re: [Tutor] input and raw input

2010-09-28 Thread John Chandler
you can use an re split... import re a=raw_input("Enter the number of your class in the school:") regex = re.compile("[ ,]") #sets the delimeters to a single space or comma m = regex.split(a) if you want to use any white space character than you can use "[\s,]" 2010/9/23 Ahmed AL-Masri > Hi,

Re: [Tutor] input and raw input

2010-09-25 Thread Peter Otten
Brian Jones wrote: > No need for the 're' module. Even in the case where both can be used > together, you can still just use string methods: > s > '12, 13 14' s.replace(',', '').split(' ') > ['12', '13', '14'] I think to replace "," with " " and then split() without explicit separator

Re: [Tutor] input and raw input

2010-09-25 Thread Evert Rol
> > any one have an idea about how we can input many number in the one time and > > change it to list. > > for example: > > > > a=input("Enter the number of your class in the school:") # the number > > can be enter as: 12,13,14 or 12 13 14 with a space in between. > > > > now how I can put th

Re: [Tutor] input and raw input

2010-09-25 Thread Brian Jones
On Sat, Sep 25, 2010 at 9:40 AM, Evert Rol wrote: > > any one have an idea about how we can input many number in the one time > and change it to list. > > for example: > > > > a=input("Enter the number of your class in the school:") # the number > can be enter as: 12,13,14 or 12 13 14 with a

Re: [Tutor] input and raw input

2010-09-25 Thread Evert Rol
> any one have an idea about how we can input many number in the one time and > change it to list. > for example: > > a=input("Enter the number of your class in the school:") # the number can > be enter as: 12,13,14 or 12 13 14 with a space in between. > > now how I can put these numbers

[Tutor] input and raw input

2010-09-25 Thread Ahmed AL-Masri
Hi, any one have an idea about how we can input many number in the one time and change it to list. for example: a=input("Enter the number of your class in the school:") # the number can be enter as: 12,13,14 or 12 13 14 with a space in between. now how I can put these numbers into list like