Question:
Python question (language)?
anonymous
2010-07-09 12:12:22 UTC
I am a complete noob at python, im just starting to learn it but im having issues right now. The book I'm reading is telling me to type:

print "game over"

when I do that, I get invalid syntax error, i am in the python shell IDLE.
What am I doing wrong?
Four answers:
Adam
2010-07-09 12:16:07 UTC
Python was changed in release 3.0.1 specifically the Print command was replaced with a Print () function



Old: print "The answer is", 2*2

New: print("The answer is", 2*2)
?
2016-10-07 11:24:21 UTC
merchandise oriented languages are incredibly generally procedural. we desire examples. C isn't merchandise oriented, that's procedural. C++ is merchandise oriented, notwithstanding as that is ordinary on C, it is likewise procedural. Calling a technique is the equivalent as calling a place with one extra argument. the top consciousness distinction in merchandise oriented languages ought to do with scope regulations, and binding suggestion to the code that acts on that suggestion. by scope regulations, i mean that merchandise oriented languages furnish factors that enable superb precise bits of your code to act on precise bits of your suggestion. So in case you have suggestion, and you desire to appreciate wherein the code is that touches it, you will have the skill to locate it extra advantageous comfortably. Procedural languages could be used in 2 strategies. One is form of a batch mode, wherein this technique launches, it does some stuff, and exits. yet another technique to make the main of them is get jointly pushed. GUI programming is maximum ordinarily ordinary this manner. the buyer clicks on some ingredient, and the get jointly handler acts on it. oftentimes, merchandise oriented languages are used for this - and that's a properly fit pondering the actuality that abode windows, cursors etc map stable to products. notwithstanding, it now not superb is additionally achieved, notwithstanding is maximum ordinarily achieved in basically undeniable C. that is my great wager that this get jointly pushed shape is the provision of your confusion.
Gina Maylarker
2010-07-09 12:14:13 UTC
i dont thnk it is possible 2 learn how to speak w/ snakes cuz they dnt have voice boxes. monkies and even dogs r nown 2 communicate w/ ppl but i never heard of som1 talkin 2 a snake. might try going 2 the zoo n talk w/ some trainers n see if u can talk 2 any of the animals. u'll be like dr dolittle! haha XD
HMJava
2010-07-09 12:17:41 UTC
Type



print("The answer is", 2*2)



Instead


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...