Skip to content

Tag: syntax-error

elif: SyntaxError: invalid syntax

I want to re.search within an if statement but regardless of identation, get syntax error. Is it because elif: has no condition? error message Answer In elif you have if, it requires a condition and you provide none, it should be Using walrus operator (since py3.8) you can improve your code to look like If th…