How to deal with the error 'invalid syntax'?

Hello @wolfram420,
this is more a generic python question rather than a ROOT related one, it’s a bit out of scope of this forum :slight_smile:

However, the invalid syntax error may be raised in many situations, I list a few

  • Missing quotes. For example, print(Hello) instead of print("Hello").
  • Misspelled reserved keywords. For example, writing iff instead of if.
  • Incorrect Indentation. For example, missing required spaces or tabs.
  • Invalid function definitions or calls. For example, missing a colon in a function definition or missing parentheses in a function call.
  • Invalid variable declarations. For example, starting the variable name with a number or using invalid characters.
  • Missing operators. For example, missing the + operator when trying to add two numbers.

Good luck,
Monica