Leandro Santos
Leandro Santos

Reputation: 67

Python 3 - Print Syntax Error

I know now in Python 3 Print is a function, but my print, I believe, is in accordance with the syntax, but still giving error Syntax

print (json.dumps(data, indent=4, sort_keys=True))

The output

print ((json.dumps(data, indent=4, sort_keys=True)))
    ^
SyntaxError: invalid syntax

Upvotes: 0

Views: 1579

Answers (1)

freedome97
freedome97

Reputation: 167

If the debugger shows at the print while saying that it is an SyntaxError, then you mostly forgot a bracket in the line before it. Can we see some more lines? Like 1 or 2 before it?

Edit: Just an example enter image description here

Upvotes: 1

Related Questions