[Tutor] Removing characters in a string using format()
Ryan Porter
websterhamster at felton4h.net
Thu Jul 21 19:53:45 CEST 2011
Hi there,
In one part of a program I'm writing, I want a list to be printed to the
string. Here's my code:
# Begin snippet
listString = input('Please enter a single item: >').strip();
/ print();
itemList.append(listString);
/
/...
/
/print('And here it is in alphabetical order:', itemList)
# End Snippet
/
However, when I print the list, I get something like this: ['Python',
'best', 'ever', 'is', 'language', 'programming', 'the'] with brackets.
Is there a way to use format() to remove the brackets before the list is
printed?
Thanks for the help!
//
More information about the Tutor
mailing list