. Sm0kin'_Bull wrote:
Hi, I got a problem with this program.
name = raw_input("Hi. What's your name? ")
called = name * 5

called = ' '.join([name]*5)

print "\nIf a small child were trying to get your attention, " \
"your name would become:"
print called
When i input the name like "John Goodman"
it prints like...
John GoodmanJohn GoodmanJohn GoodmanJohn GoodmanJohn Goodman
But i want to print it like...
John Goodman John Goodman John Goodman John Goodman John Goodman
How can I do it?



[name]*5 gives you a list with five items, every item is name. join uses a space (' ') to join all items in the list into a new string.


HTH,
Wolfram

_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to