Reputation: 31
e=input('what's your name?')
print('so you %s, %s, %s.' % (e,l,x))
I want to create a program where I'm required to answer my questions, but using input() just returns [so you , , .]
.
Upvotes: 2
Views: 14863
Reputation: 2386
OK, I'm guessing you're talking about Python 3.6.
First mistake:
e=input('what's your name?') #notice how you're using too many "'"
Correct:
e=input("what's your name?")
Second mistake:
print('so you %s, %s, %s.' % (e,l,x))
#you did not specify l and x, so Python will throw an error
Correct:
Declare and assign values to the "l" and "x" variables before using them.
Just make an input like you did to "e", for example:
l=input("what's your L?")
raw_input
s because all inputs are raw_input
s.input
because it was too problematic. So Python's 3 input
== Python's 2 raw_input
.
To use Python's 2 regular input
in Python 3, use eval(input())
. For more information, see: http://docs.python.org/dev/py3k/whatsnew/3.0.html
Upvotes: 11