Warning

This project is being split into 3 separate projects:

  • friendly_traceback,

  • friendly, and

  • friendly_idle.

The documentation does not reflect this change.

If you are a end-user, just install friendly until further notice.

Comparison between Python versions: SyntaxErrors

In this file, we highlight differences between the information given by different versions of Python when it comes to SyntaxError. The content of this file is likely of no use to anyone except for people who write code to include new SyntaxError cases.

The differences between Python versions can be:

  1. The error message itself.

  2. The location of the error as indicated by Python with ^. We’ve decided to leave these out for now.

As a consequence, the information as to what we guess is the cause can be slightly different. So, we also show when we assign a different cause.

Note that the content below is extracted automaticaly by a simple program we wrote for this purpose. If the information is the same for Python 3.6 and 3.7, but changes for Python 3.8, we only show the differences between 3.7 and 3.8.

cannot_guess_the_cause
Different messages - from Python
3.9: SyntaxError: invalid syntax

3.10: SyntaxError: invalid syntax. Perhaps you forgot a comma?

walrus_instead_of_equal
Different messages - from Python
3.7: Either not a SyntaxError for this Python version, or case excluded for some other reason.
3.8: SyntaxError: invalid syntax

Different explanation - by Friendly-traceback
3.7: Either not a SyntaxError for this Python version, or case excluded for some other reason.
3.8: You use the augmented assignment operator `:=` where
the normal assignment operator `=` was required.

and_in_import_statement_2
Different messages - from Python
3.8: SyntaxError: invalid syntax

3.9: SyntaxError: trailing comma not allowed without surrounding parentheses

Different explanation - by Friendly-traceback
3.8: The Python keyword `and` can only be used for boolean expressions.
Perhaps you meant to write

`from math import sin, tan,  cos`

3.9: Python gave us the following informative message
about the possible cause of the error:

    trailing comma not allowed without surrounding parentheses

However, I do not recognize this information and I have
to guess what caused the problem, but I might be wrong.

The Python keyword `and` can only be used for boolean expressions.
Perhaps you meant to write

`from math import sin, tan,  cos`

except_multiple_exceptions
Different messages - from Python
3.9: SyntaxError: invalid syntax

3.10: SyntaxError: multiple exception types must be parenthesized

Different explanation - by Friendly-traceback
3.9: I am guessing that you wanted to use an `except` statement
with multiple exception types. If that is the case, you must
surround them with parentheses.

3.10: I am guessing that you wanted to use an `except` statement
with multiple exception types. If that is the case, you must
surround them with parentheses.


missing_code_block
Different messages - from Python
3.8: SyntaxError: unexpected EOF while parsing

3.9: IndentationError: expected an indented block

3.10: IndentationError: expected an indented block after 'for' statement on line 3

Different explanation - by Friendly-traceback
3.8: Python tells us that it reached the end of the file
and expected more content.


3.9: The line identified above
was expected to begin a new indented block.

missing_parens_for_range
Different messages - from Python
3.9: SyntaxError: invalid syntax

3.10: SyntaxError: expected ':'

Different explanation - by Friendly-traceback
3.9: It looks as though you forgot to use to use parenthesis with `range`.
Perhaps you meant:

    for i in range( 3):


3.10: Python told us that it expected a colon at the position indicated.
However, adding a colon or replacing something else by a colon
would not fix the problem.
It looks as though you forgot to use to use parenthesis with `range`.
Perhaps you meant:

    for i in range( 3):


pip_install_1
Different messages - from Python
3.9: SyntaxError: invalid syntax

3.10: SyntaxError: invalid syntax. Perhaps you forgot a comma?

python_interpreter
Different messages - from Python
3.9: SyntaxError: invalid syntax

3.10: SyntaxError: invalid syntax. Perhaps you forgot a comma?

missing_colon_if
Different messages - from Python
3.9: SyntaxError: invalid syntax

3.10: SyntaxError: expected ':'

else_if_instead_of_elif
Different messages - from Python
3.9: SyntaxError: invalid syntax

3.10: SyntaxError: expected ':'

Different explanation - by Friendly-traceback
3.9: You likely meant to use Python's `elif` keyword
but wrote `else if` instead.


3.10: Python told us that it expected a colon at the position indicated.
However, adding a colon or replacing something else by a colon
would not fix the problem.
You likely meant to use Python's `elif` keyword
but wrote `else if` instead.


augmented_assigment_with_true
Different messages - from Python
3.7: SyntaxError: invalid syntax

3.8: SyntaxError: cannot use assignment expressions with True

Different explanation - by Friendly-traceback
3.6: You appear to be using the operator `:=`, sometimes called
the walrus operator. This operator requires the use of
Python 3.8 or newer. You are using version 3.6.

3.7: You appear to be using the operator `:=`, sometimes called
the walrus operator. This operator requires the use of
Python 3.8 or newer. You are using version 3.7.

3.8: `True` is a constant in Python; you cannot assign it a different value.

assign_to_function_call_2
Different messages - from Python
3.7: SyntaxError: can't assign to function call

3.8: SyntaxError: cannot assign to function call

3.10: SyntaxError: cannot assign to function call here. Maybe you meant '==' instead of '='?

def_forward_slash_1
Different explanation - by Friendly-traceback
3.6: `/` indicates that the previous arguments in a function definition
are positional arguments.
This symbol can only be used with Python versions 3.8.0 or newer.
You are using Python version 3.6.8.

3.7: `/` indicates that the previous arguments in a function definition
are positional arguments.
This symbol can only be used with Python versions 3.8.0 or newer.
You are using Python version 3.7.8.

3.8: `/` indicates that the previous arguments in a function definition
are positional arguments.
You have unspecified keyword arguments that appear before
the symbol `/`.

copy_pasted_code_2
Different messages - from Python
3.9: SyntaxError: invalid syntax

3.10: SyntaxError: invalid syntax. Perhaps you forgot a comma?

assign_to_literal_int_3
Different messages - from Python
3.7: SyntaxError: can't assign to literal

3.8: SyntaxError: cannot assign to literal

invalid_identifier_2
Different messages - from Python
3.9: SyntaxError: invalid syntax

3.10: SyntaxError: invalid decimal literal

missing_in_with_for
Different messages - from Python
3.9: SyntaxError: invalid syntax

3.10: SyntaxError: invalid syntax. Perhaps you forgot a comma?

single_equal_with_elif
Different messages - from Python
3.9: SyntaxError: invalid syntax

3.10: SyntaxError: cannot assign to expression here. Maybe you meant '==' instead of '='?

Different explanation - by Friendly-traceback
3.9: You likely used an assignment operator `=` instead of an equality operator `==`.

3.10: You wrote an expression that includes some mathematical operations
on the left-hand side of the equal sign which should be
only used to assign a value to a variable.

assign_to_ellipsis
Different messages - from Python
3.7: SyntaxError: can't assign to Ellipsis

3.8: SyntaxError: cannot assign to Ellipsis

3.10: SyntaxError: cannot assign to ellipsis here. Maybe you meant '==' instead of '='?

unclosed_bracket
Different messages - from Python
3.9: SyntaxError: invalid syntax

3.10: SyntaxError: '[' was never closed

missing_comma_in_list
Different messages - from Python
3.9: SyntaxError: invalid syntax

3.10: SyntaxError: invalid syntax. Perhaps you forgot a comma?

python_not_interpreter
Different messages - from Python
3.9: SyntaxError: invalid syntax

3.10: SyntaxError: invalid syntax. Perhaps you forgot a comma?

unterminated_triple_quote_string
Different messages - from Python
3.9: SyntaxError: EOF while scanning triple-quoted string literal

3.10: SyntaxError: unterminated triple-quoted string literal (detected at line 4)

delete_string_literal
Different messages - from Python
3.7: SyntaxError: can't delete literal

3.8: SyntaxError: cannot delete literal

elseif_instead_of_elif
Different messages - from Python
3.9: SyntaxError: invalid syntax

3.10: SyntaxError: invalid syntax. Perhaps you forgot a comma?

quote_inside_string
Different messages - from Python
3.9: SyntaxError: invalid syntax

3.10: SyntaxError: unterminated string literal (detected at line 3)

Different explanation - by Friendly-traceback
3.9: There appears to be a Python identifier (variable name)
immediately following a string.
I suspect that you were trying to use a quote inside a string
that was enclosed in quotes of the same kind.

3.10: You started writing a string with a single or double quote
but never ended the string with another quote on that line.

generator_expression_parens
Different messages - from Python
3.6: SyntaxError: Generator expression must be parenthesized if not sole argument

3.7: SyntaxError: Generator expression must be parenthesized

eol_string_literal
Different messages - from Python
3.9: SyntaxError: EOL while scanning string literal

3.10: SyntaxError: unterminated string literal (detected at line 3)

invalid_character_in_identifier
Different messages - from Python
3.8: SyntaxError: invalid character in identifier

3.9: SyntaxError: invalid character '🤖' (U+1F916)

def_forward_slash_2
Different explanation - by Friendly-traceback
3.6: `/` indicates that the previous arguments in a function definition
are positional arguments.
This symbol can only be used with Python versions 3.8.0 or newer.
You are using Python version 3.6.8.

3.7: `/` indicates that the previous arguments in a function definition
are positional arguments.
This symbol can only be used with Python versions 3.8.0 or newer.
You are using Python version 3.7.8.

3.8: `/` indicates that the previous arguments in a function definition
are positional arguments.
However, `*` indicates that the arguments
that follow must be keyword arguments.
When they are used together, `/` must appear before `*`.

assign_to_literal_int
Different messages - from Python
3.7: SyntaxError: can't assign to literal

3.8: SyntaxError: cannot assign to literal

3.10: SyntaxError: cannot assign to literal here. Maybe you meant '==' instead of '='?

unmatched_closing_bracket_1
Different messages - from Python
3.7: SyntaxError: invalid syntax

3.8: SyntaxError: closing parenthesis ']' does not match opening parenthesis '('

imaginary_i
Different messages - from Python
3.9: SyntaxError: invalid syntax

3.10: SyntaxError: invalid decimal literal

assign_to_operation
Different messages - from Python
3.7: SyntaxError: can't assign to operator

3.8: SyntaxError: cannot assign to operator

3.10: SyntaxError: cannot assign to expression here. Maybe you meant '==' instead of '='?

invalid_hexadecimal
Different messages - from Python
3.9: SyntaxError: invalid syntax

3.10: SyntaxError: invalid hexadecimal literal

missing_comma_in_dict
Different messages - from Python
3.9: SyntaxError: invalid syntax

3.10: SyntaxError: invalid syntax. Perhaps you forgot a comma?

print_is_a_function_2
Different messages - from Python
3.9: SyntaxError: invalid syntax

3.10: SyntaxError: invalid syntax. Perhaps you forgot a comma?

assign_to_f_string
Different messages - from Python
3.7: SyntaxError: can't assign to literal

3.8: SyntaxError: cannot assign to f-string expression

3.10: SyntaxError: cannot assign to f-string expression here. Maybe you meant '==' instead of '='?

assign_to_debug2
Different messages - from Python
3.7: SyntaxError: assignment to keyword

3.8: SyntaxError: cannot assign to __debug__

unmatched_closing_paren
Different messages - from Python
3.7: SyntaxError: invalid syntax

3.8: SyntaxError: unmatched ')'

Different explanation - by Friendly-traceback
3.7: The closing parenthesis `)` on line 6 does not match anything.

    6:     3, 4,))
                 ^

3.8: The closing parenthesis `)` on line 6 does not match anything.

cannot_use_double_star
Different messages - from Python
3.8: SyntaxError: invalid syntax

3.9: SyntaxError: f-string: invalid syntax

3.10: SyntaxError: f-string: cannot use double starred expression here

assign_to_conditional
Different messages - from Python
3.7: SyntaxError: can't assign to conditional expression

3.8: SyntaxError: cannot assign to conditional expression

unescaped_backslash
Different messages - from Python
3.9: SyntaxError: EOL while scanning string literal

3.10: SyntaxError: unterminated string literal (detected at line 1)

unicode_quote
Different messages - from Python
3.8: SyntaxError: invalid character in identifier

3.9: SyntaxError: invalid character '«' (U+00AB)

assign_to_keyword_none
Different messages - from Python
3.7: SyntaxError: can't assign to keyword

3.8: SyntaxError: cannot assign to None

missing_colon_while
Different messages - from Python
3.9: SyntaxError: invalid syntax

3.10: SyntaxError: expected ':'

unclosed_paren_2
Different messages - from Python
3.9: SyntaxError: invalid syntax

3.10: SyntaxError: '(' was never closed

assign_to_function_call_1
Different messages - from Python
3.7: SyntaxError: can't assign to function call

3.8: SyntaxError: cannot assign to function call

3.10: SyntaxError: cannot assign to function call here. Maybe you meant '==' instead of '='?

integer_with_leading_zero_2
Different messages - from Python
3.7: SyntaxError: invalid token

3.8: SyntaxError: leading zeros in decimal integer literals are not permitted; use an 0o prefix for octal integers

unexpected_eof
Different messages - from Python
3.9: SyntaxError: unexpected EOF while parsing

3.10: SyntaxError: '[' was never closed

Different explanation - by Friendly-traceback
3.9: Python tells us that it reached the end of the file
and expected more content.

I will attempt to be give a bit more information.

The opening square bracket `[` on line 5 is not closed.

    5:     return [1, 2, 3,
                  ^

3.10: The opening square bracket `[` on line 5 is not closed.

    5:     return [1, 2, 3,
                  ^

comprehension_missing_tuple_paren
Different messages - from Python
3.9: SyntaxError: invalid syntax

3.10: SyntaxError: did you forget parentheses around the comprehension target?

delete_constant_keyword
Different messages - from Python
3.7: SyntaxError: can't delete keyword

3.8: SyntaxError: cannot delete True

would_be_type_declaration_2
Different messages - from Python
3.7: Either not a SyntaxError for this Python version, or case excluded for some other reason.
3.8: SyntaxError: invalid syntax

3.10: SyntaxError: invalid syntax. Perhaps you forgot a comma?

Different explanation - by Friendly-traceback
3.7: Either not a SyntaxError for this Python version, or case excluded for some other reason.
3.8: It looks like you were trying to declare that `start` was
a variable using the word `var`.
However, even if you remove `var`, there would still be some
some syntax errors.

3.10: It looks like you were trying to declare that `var` was
a variable using the word `var`.
However, even if you remove `var`, there would still be some
some syntax errors.

single_equal_with_while
Different messages - from Python
3.9: SyntaxError: invalid syntax

3.10: SyntaxError: invalid syntax. Maybe you meant '==' or ':=' instead of '='?

Different explanation - by Friendly-traceback
3.7: You likely used an assignment operator `=` instead of an equality operator `==`.

3.8: You used an assignment operator `=`; perhaps you meant to use 
an equality operator, `==`, or the walrus operator `:=`.

unmatched_closing_bracket_3
Different messages - from Python
3.7: SyntaxError: invalid syntax

3.8: SyntaxError: unmatched ']'

Different explanation - by Friendly-traceback
3.7: The closing square bracket `]` on line 3 does not match anything.

    3:      3]]
              ^

3.8: The closing square bracket `]` on line 3 does not match anything.

future_unknown
Different explanation - by Friendly-traceback
3.6: `something` is not a valid feature of module `__future__`.

The available features are `nested_scopes,
 generators,
 division,
 absolute_import,
 with_statement,
 print_function,
 unicode_literals,
 barry_as_FLUFL,
 generator_stop`.

3.7: `something` is not a valid feature of module `__future__`.

The available features are `nested_scopes,
 generators,
 division,
 absolute_import,
 with_statement,
 print_function,
 unicode_literals,
 barry_as_FLUFL,
 generator_stop,
 annotations`.

def_star_arg_before_slash
Different explanation - by Friendly-traceback
3.6: `/` indicates that the previous arguments in a function definition
are positional arguments.
This symbol can only be used with Python versions 3.8.0 or newer.
You are using Python version 3.6.8.

3.7: `/` indicates that the previous arguments in a function definition
are positional arguments.
This symbol can only be used with Python versions 3.8.0 or newer.
You are using Python version 3.7.8.

3.8: `/` indicates that the previous arguments in a function definition
are positional arguments.
`*arg` must appear after `/` in a function definition.

fstring_assign_value
Different messages - from Python
3.7: SyntaxError: invalid syntax

3.8: Either not a SyntaxError for this Python version, or case excluded for some other reason.
Different explanation - by Friendly-traceback
3.7: You are likely trying to assign a value within an f-string.
This is not allowed.

3.8: Either not a SyntaxError for this Python version, or case excluded for some other reason.
indentation_error_1
Different messages - from Python
3.9: IndentationError: expected an indented block

3.10: IndentationError: expected an indented block after 'if' statement on line 3

pip_install_2
Different messages - from Python
3.9: SyntaxError: invalid syntax

3.10: SyntaxError: invalid syntax. Perhaps you forgot a comma?

unmatched_closing_curly
Different messages - from Python
3.7: SyntaxError: invalid syntax

3.8: SyntaxError: unmatched '}'

Different explanation - by Friendly-traceback
3.7: The closing curly bracket `}` on line 6 does not match anything.

    6:     3, 4,}}
                 ^

3.8: The closing curly bracket `}` on line 6 does not match anything.

missing_comma_in_tuple
Different messages - from Python
3.9: SyntaxError: invalid syntax

3.10: SyntaxError: invalid syntax. Perhaps you forgot a comma?

hyphen_instead_of_underscore
Different messages - from Python
3.7: SyntaxError: can't assign to operator

3.8: SyntaxError: cannot assign to operator

3.10: SyntaxError: cannot assign to expression here. Maybe you meant '==' instead of '='?

unclosed_paren_1
Different messages - from Python
3.9: SyntaxError: invalid syntax

3.10: SyntaxError: '(' was never closed

assign_to_literal_set
Different messages - from Python
3.7: SyntaxError: can't assign to literal

3.8: SyntaxError: cannot assign to set display

3.10: SyntaxError: cannot assign to set display here. Maybe you meant '==' instead of '='?

def_function_name_invalid
Different messages - from Python
3.9: SyntaxError: invalid syntax

3.10: SyntaxError: invalid decimal literal

assign_to_debug
Different messages - from Python
3.7: SyntaxError: assignment to keyword

3.8: SyntaxError: cannot assign to __debug__

assign_to_literal_dict
Different messages - from Python
3.7: SyntaxError: can't assign to literal

3.8: SyntaxError: cannot assign to dict display

3.10: SyntaxError: cannot assign to dict literal here. Maybe you meant '==' instead of '='?

invalid_octal
Different messages - from Python
3.7: SyntaxError: invalid syntax

3.8: SyntaxError: invalid digit '8' in octal literal

space_in_variable_name
Different messages - from Python
3.9: SyntaxError: invalid syntax

3.10: SyntaxError: invalid syntax. Perhaps you forgot a comma?

invalid_identifier_5
Different messages - from Python
3.9: SyntaxError: invalid syntax

3.10: SyntaxError: invalid imaginary literal

assign_to_generator
Different messages - from Python
3.7: SyntaxError: can't assign to generator expression

3.8: SyntaxError: cannot assign to generator expression

def_forward_slash_3
Different explanation - by Friendly-traceback
3.6: `/` indicates that the previous arguments in a function definition
are positional arguments.
This symbol can only be used with Python versions 3.8.0 or newer.
You are using Python version 3.6.8.

3.7: `/` indicates that the previous arguments in a function definition
are positional arguments.
This symbol can only be used with Python versions 3.8.0 or newer.
You are using Python version 3.7.8.

3.8: `/` indicates that the previous arguments in a function definition
are positional arguments.
`*arg` must appear after `/` in a function definition.

integer_with_leading_zero_1
Different messages - from Python
3.7: SyntaxError: invalid token

3.8: SyntaxError: leading zeros in decimal integer literals are not permitted; use an 0o prefix for octal integers

invalid_identifier_4
Different messages - from Python
3.9: SyntaxError: invalid syntax

3.10: SyntaxError: invalid imaginary literal

debug_fstring_not_supported
Different messages - from Python
3.7: SyntaxError: invalid syntax

3.8: Either not a SyntaxError for this Python version, or case excluded for some other reason.
Different explanation - by Friendly-traceback
3.6: You are likely using a 'debug' syntax of f-strings introduced
in Python version 3.8. You are using version 3.6.

3.7: You are likely using a 'debug' syntax of f-strings introduced
in Python version 3.8. You are using version 3.7.

3.8: Either not a SyntaxError for this Python version, or case excluded for some other reason.
invalid_keyword_argument
Different messages - from Python
3.7: SyntaxError: keyword can't be an expression

3.8: SyntaxError: expression cannot contain assignment, perhaps you meant "=="?

Different explanation - by Friendly-traceback
3.7: You likely called a function with a named argument:

    a_function(invalid=something) 

where `invalid` is not a valid variable name in Python
either because it starts with a number, or is a string,
or contains a period, etc.


3.8: One of the following two possibilities could be the cause:
1. You meant to do a comparison with == and wrote = instead.
2. You called a function with a named argument:

        a_function(invalid=...)

where `invalid` is not a valid identifier (variable name) in Python
either because it starts with a number, or is a string,
or contains a period, etc.


def_forward_slash_4
Different explanation - by Friendly-traceback
3.6: `/` indicates that the previous arguments in a function definition
are positional arguments.
This symbol can only be used with Python versions 3.8.0 or newer.
You are using Python version 3.6.8.

3.7: `/` indicates that the previous arguments in a function definition
are positional arguments.
This symbol can only be used with Python versions 3.8.0 or newer.
You are using Python version 3.7.8.

3.8: You can only use `/` once in a function definition.

unmatched_closing_bracket_2
Different messages - from Python
3.7: SyntaxError: invalid syntax

3.8: SyntaxError: closing parenthesis ']' does not match opening parenthesis '(' on line 2

assign_to_literal_int_2
Different messages - from Python
3.7: SyntaxError: can't assign to literal

3.8: SyntaxError: cannot assign to literal

3.10: SyntaxError: cannot assign to literal here. Maybe you meant '==' instead of '='?

future_import_star
Different explanation - by Friendly-traceback
3.6: When using a `from __future__ import` statement,
you must import specific named features.

The available features are `nested_scopes,
 generators,
 division,
 absolute_import,
 with_statement,
 print_function,
 unicode_literals,
 barry_as_FLUFL,
 generator_stop`.

3.7: When using a `from __future__ import` statement,
you must import specific named features.

The available features are `nested_scopes,
 generators,
 division,
 absolute_import,
 with_statement,
 print_function,
 unicode_literals,
 barry_as_FLUFL,
 generator_stop,
 annotations`.

keyword_arg_repeated
Different messages - from Python
3.8: SyntaxError: keyword argument repeated

3.9: SyntaxError: keyword argument repeated: ad

invalid_identifier_3
Different messages - from Python
3.9: SyntaxError: invalid syntax

3.10: SyntaxError: invalid imaginary literal

walrus_does_not_exist
Different messages - from Python
3.7: SyntaxError: invalid syntax

3.8: Either not a SyntaxError for this Python version, or case excluded for some other reason.
Different explanation - by Friendly-traceback
3.6: You appear to be using the operator `:=`, sometimes called
the walrus operator. This operator requires the use of
Python 3.8 or newer. You are using version 3.6.

3.7: You appear to be using the operator `:=`, sometimes called
the walrus operator. This operator requires the use of
Python 3.8 or newer. You are using version 3.7.

3.8: Either not a SyntaxError for this Python version, or case excluded for some other reason.
def_semi_colon_instead_of_colon
Different messages - from Python
3.9: SyntaxError: invalid syntax

3.10: SyntaxError: expected ':'

Different explanation - by Friendly-traceback
3.9: A function definition statement must end with a colon.
You wrote `;` instead of a colon.

3.10: Python expected a colon at the position indicated.
You wrote `;` instead of a colon.

print_is_a_function_5
Different messages - from Python
3.9: SyntaxError: invalid syntax

3.10: SyntaxError: invalid syntax. Perhaps you forgot a comma?

literal_in_for_loop
Different messages - from Python
3.7: SyntaxError: can't assign to literal

3.8: SyntaxError: cannot assign to literal

missing_comma_in_set
Different messages - from Python
3.9: SyntaxError: invalid syntax

3.10: SyntaxError: invalid syntax. Perhaps you forgot a comma?

def_missing_colon
Different messages - from Python
3.9: SyntaxError: invalid syntax

3.10: SyntaxError: expected ':'

Different explanation - by Friendly-traceback
3.9: A function definition statement must end with a colon.

3.10: You wrote a statement beginning with
`def` but forgot to add a colon `:` at the end.


would_be_type_declaration_1
Different messages - from Python
3.7: Either not a SyntaxError for this Python version, or case excluded for some other reason.
3.8: SyntaxError: invalid syntax

3.10: SyntaxError: invalid syntax. Perhaps you forgot a comma?

Different explanation - by Friendly-traceback
3.7: Either not a SyntaxError for this Python version, or case excluded for some other reason.
3.8: It looks like you were trying to declare that `start` was
a variable using the word `var`.
If you remove `var`, you will have a valid Python statement.

3.10: It looks like you were trying to declare that `var` was
a variable using the word `var`.
If you remove `var`, you will have a valid Python statement.

print_is_a_function_4
Different messages - from Python
3.9: SyntaxError: invalid syntax

3.10: SyntaxError: invalid syntax. Perhaps you forgot a comma?

single_equal_with_if
Different messages - from Python
3.9: SyntaxError: invalid syntax

3.10: SyntaxError: cannot assign to expression here. Maybe you meant '==' instead of '='?

Different explanation - by Friendly-traceback
3.9: You likely used an assignment operator `=` instead of an equality operator `==`.

3.10: You wrote an expression that includes some mathematical operations
on the left-hand side of the equal sign which should be
only used to assign a value to a variable.

augmented_assignment_to_literal
Different messages - from Python
3.7: SyntaxError: invalid syntax

3.8: SyntaxError: cannot use assignment expressions with literal

Different explanation - by Friendly-traceback
3.6: You appear to be using the operator `:=`, sometimes called
the walrus operator. This operator requires the use of
Python 3.8 or newer. You are using version 3.6.

3.7: You appear to be using the operator `:=`, sometimes called
the walrus operator. This operator requires the use of
Python 3.8 or newer. You are using version 3.7.

3.8: You cannot use the augmented assignment operator `:=`,
sometimes called the walrus operator, with literals like `"word"`.
You can only assign objects to identifiers (variable names).

delete_function_call
Different messages - from Python
3.7: SyntaxError: can't delete function call

3.8: SyntaxError: cannot delete function call

invalid_identifier
Different messages - from Python
3.9: SyntaxError: invalid syntax

3.10: SyntaxError: invalid decimal literal