i enter this into print (raw_input('What is your name? ')) it says syntaxerror: invalid syntax.. what am o doing wrong
MIT 6.00 Intro Computer Science (OCW)
Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga.
Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus.
Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
You do not need to print it. rawinput automatically prints what you supplied.
Read more examples here:
Which version of Python are you using? The way you wrote print() is Python v3 syntax. raw_input() is much different in Python v3, it's basically a Python v2 function.
give a variable name to your input so...
a = (raw_input("what is your name: "))
print a // you are calling the variable to print
Not the answer you are looking for? Search for more explanations.
In this case it would be easy to do this using a variables. The code may look like something like this.
question = "What is your name"
answer = raw_input ()
also refer input and output section of the python wikibook
Assuming you are using python 2.7 print (raw_input ('What is your name?')) is correct. However as is explained in the python wiki book input and out put section that "No inputted statements ca span more than one line" So if you run just the above line the programe should look something like What is your name . however if you have another input statement, after print (raw_input ('What is your name')) the code will return an error message.
Was there by any chance an input staement before print (raw_input ('What is your name?'))?. in this case you can use variables as was shown in my previous reply
Or you can simply type
raw_input (what is your name ?)