On 05/02/15 23:57, Edgar Figueroa wrote:

name = input("Hello. What's your name? ")
print("\nHello", name, ". Nice to meet you.")
favFood1 = input("\n", name, ", what's your favorite food? ")

Obviously it isn't working.

You need to construct a single string argument.
There are several options:

"\n" + name + ", what's your favorite food? "

Or, better IMHO, use string formatting:

"\n {}, what's your favorite food? ".format(name)

formatting has the advantage of allowing you to insert multiple values of different types and control spacing, justification and other aspects of appearance.

--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to