Python Forum
fell at the first hurdle sigh
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
fell at the first hurdle sigh
#1
Python 3.7.2 (tags/v3.7.2:9a3ffc0492, Dec 23 2018, 23:09:28) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>> print "End Game"
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("End Game")?
>>>
Reply
#2
Read the error message. It's quite clear what's wrong, and even how to fix it.
>>> print("End Game")
The way you have it will work in antique python (2.7 or earlier) only
print "End Game"
Reply
#3
print "End Game" is python 2 syntax. In python 3 print is a function and as the error suggest the correct syntax is
print("End Game"). Probably the learning material is for python2. You are right to use python3, so if it's the learning material that cause the confusion - find a book for python3
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020