3 Replies - 313 Views - Last Post: 28 February 2014 - 07:42 AM Rate Topic: -----

#1 syrith  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 28-February 14

SyntaxError: invalid syntax - print()

Posted 28 February 2014 - 07:12 AM

Hi, I'm new here, just registered. I'm getting an error with my print code. My code is below, and below that is the error I'm getting. If anyone could help it would be greatly appreciated as I am trying to make a simple game in my spare time as I learn to program and this is a big roadblock for me. :)/>

if input(character):
    print("Your name is ", (char1.name1))
    print("You are ", (char1.age1), ("years old")
    print("Strength = ", (char1.strength1))
    print("cunning = ", (char1.cunning1))
    print("speed = ", (char1.speed1))


C:\Python33\python.exe C:/Users/Syrith/PycharmProjects/1/Story.py
  File "C:/Users/Syrith/PycharmProjects/1/Story.py", line 20
    print("Strength = ", (char1.strength1))
        ^
SyntaxError: invalid syntax

Process finished with exit code 1


Is This A Good Question/Topic? 0
  • +

Replies To: SyntaxError: invalid syntax - print()

#2 andrewsw  Icon User is online

  • Fire giant boob nipple gun!
  • member icon

Reputation: 3247
  • View blog
  • Posts: 10,891
  • Joined: 12-December 12

Re: SyntaxError: invalid syntax - print()

Posted 28 February 2014 - 07:17 AM

You are missing a closing bracket on line 3.
Was This Post Helpful? 1
  • +
  • -

#3 syrith  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 28-February 14

Re: SyntaxError: invalid syntax - print()

Posted 28 February 2014 - 07:20 AM

Thank-you very much, I know I'm new to this but still shouldn't have missed that. I was focusing on where the little arrow was pointing thinking it was to do with the print function :stupid:
Was This Post Helpful? 0
  • +
  • -

#4 andrewsw  Icon User is online

  • Fire giant boob nipple gun!
  • member icon

Reputation: 3247
  • View blog
  • Posts: 10,891
  • Joined: 12-December 12

Re: SyntaxError: invalid syntax - print()

Posted 28 February 2014 - 07:42 AM

No worries.

Yes, the error indicator only indicates where the error was discovered, it is often caused earlier than this.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1