[Tutor] How do I call a variable within an input () function?
Edgar Figueroa
figgypops at hotmail.com
Fri Feb 6 00:57:06 CET 2015
Hello group. I'm trying to call the variable "name" within my input () function.
Here's what I have:
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. It tells me I have too many arguments for the input () function. Basically, I want the output to read as follows:
Hello. What's your name?
user enters "Frank"
Hello Frank. Nice to meet you.
Frank, what's your favorite food?
Any help would be greatly appreciated.
Thanks.
More information about the Tutor
mailing list