Python Forum
Invalid Syntax when using print?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Invalid Syntax when using print?
#1
print("test")
Thats the code and it's saying invalid syntax.

Another thing that is giving me an invalid synatx is

print("  /")
i'm using python 3.6.0.
Reply
#2
Are you sure there isn't a syntax error on the previous line?
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply
#3
Neither of those should be giving invalid syntax, is there more code before this that could actually have the error.
Reply
#4
Update:

this is giving me invalid syntax now.

print(10 % 3)
Reply
#5
You're not heeding advise, post code prior to your print statement.
It's likely that something as simple as a close parenthesis in the previous line of code is causing your syntax error.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [split] SyntaxError: invalid syntax Code_X 3 426 May-04-2021, 05:15 PM
Last Post: Yoriz
  Invalid syntax error - need help fixing calgk01 3 652 Feb-23-2021, 08:41 PM
Last Post: nilamo
  Invalid syntax using conditionals if - else jperezqu 1 598 Jan-13-2021, 07:32 PM
Last Post: bowlofred
  invalid syntax in line 5. Help Asadzangibaloch 2 605 Dec-10-2020, 04:26 PM
Last Post: deanhystad
  Error on nested loop : Invalid syntax dvazquezgu 3 673 Nov-25-2020, 10:04 AM
Last Post: palladium
  "SyntaxError: invalid syntax" running code in Doing Math With Python b saucerdesigner 2 636 Nov-03-2020, 04:23 PM
Last Post: saucerdesigner
  invalid syntax (BEGINNER) Shishi 21 1,507 Oct-16-2020, 01:45 PM
Last Post: Askic
  Invalid Syntax error Dave1835 2 671 Sep-21-2020, 04:38 AM
Last Post: perfringo
  invalid syntax when trying install package Omer_ 1 637 Jul-28-2020, 03:51 PM
Last Post: buran
  Invalid syntax on print function DoctorSmiles 2 1,094 Jul-12-2020, 07:39 PM
Last Post: DoctorSmiles

Forum Jump:

User Panel Messages

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