[Tutor] unexpected list entry

bob gailer bgailer at gmail.com
Fri Dec 2 15:08:15 CET 2011


On 12/2/2011 8:49 AM, surya k wrote:
> Hi,
> Just take a look at this small code.. I am just taking a string as 
> input and assigning it as a list.
> But I am finding an unexpected entry in the list.. Why this is happening?
> I am using PyScripter IDE.
> code :
> #!/usr/bin/env python
> def main():
>     pass
> if __name__ == '__main__':
>     main()
> print "Flames: "
> name1 = raw_input('enter name 1')
> ListName1 = list(name1)
> print name1
> print ListName1
> Output:
> Flames:
> foo
> *[u'f', u'o', u'o']*
> Observe the last line.. it isn't showing [ 'f', 'o', 'o']
> Why is that "u" coming in the middle from no where ??
input is returning user entry as unicode.

-- 
Bob Gailer
919-636-4239
Chapel Hill NC

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20111202/50c6d5b5/attachment.html>


More information about the Tutor mailing list