On Tue, Feb 24, 2009 at 10:16 AM, Taylan Karaman <taylankara...@gmail.com> wrote: > Hello, > > I am a beginner. And I am trying to get a user input converted to a list. > > print 'Enter your first name :' > firstname = raw_input() > > So if the user input is > > firstname = 'foo' ----------->should become--------> > firstlist['f','o','o']
Strings behave as sequences of characters, so you can just do firstname = 'foo' firstlist = list(firstname) If you just want to iterate over the letters, there is no need to create a separate list, you can iterate over the string directly, e.g. for letter in firstname: print letter Kent _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor