Python Forum
Invalid syntax on print function
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Invalid syntax on print function
#3
(Jul-12-2020, 07:33 PM)bowlofred Wrote: Some times a syntax error detected on one line means you did something wrong before that point.

Here line 14 doesn't have balanced parentheses. It was hoping the next line would balance them, but when it found the print function leaving the while loop without balancing, it triggered the error.

Yep that fixed it, thanks!!
Reply


Messages In This Thread
Invalid syntax on print function - by DoctorSmiles - Jul-12-2020, 07:27 PM
RE: Invalid syntax on print function - by bowlofred - Jul-12-2020, 07:33 PM
RE: Invalid syntax on print function - by DoctorSmiles - Jul-12-2020, 07:39 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  print doesnt work in a function ony 2 324 Mar-11-2024, 12:42 PM
Last Post: Pedroski55
  print(data) is suddenly invalid syntax db042190 6 1,243 Jun-14-2023, 02:55 PM
Last Post: deanhystad
  How to print variables in function? samuelbachorik 3 929 Dec-31-2022, 11:12 PM
Last Post: stevendaprano
  [Solved] unkown (to me) function def parm "name1:name2" syntax. MvGulik 5 1,110 Nov-11-2022, 11:21 AM
Last Post: MvGulik
  How to print the output of a defined function bshoushtarian 4 1,337 Sep-08-2022, 01:44 PM
Last Post: deanhystad
  meaning of -> syntax in function definition DrakeSoft 5 2,013 Apr-09-2022, 07:45 AM
Last Post: DrakeSoft
  SyntaxError: invalid syntax ?? korenron 15 5,824 Jan-25-2022, 11:46 AM
Last Post: korenron
  Invalid syntax with an f-string Mark17 7 7,934 Jan-14-2022, 04:44 PM
Last Post: Mark17
  Why does absence of print command outputs quotes in function? Mark17 2 1,412 Jan-04-2022, 07:08 PM
Last Post: ndc85430
  return vs. print in nested function example Mark17 4 1,784 Jan-04-2022, 06:02 PM
Last Post: jefsummers

Forum Jump:

User Panel Messages

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