We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fe17ada commit 345964aCopy full SHA for 345964a
Lib/test/test_syntax.py
@@ -918,6 +918,18 @@
918
...
919
SyntaxError: 'break' outside loop
920
921
+elif can't come after an else.
922
+
923
+ >>> if a % 2 == 0:
924
+ ... pass
925
+ ... else:
926
927
+ ... elif a % 2 == 1:
928
929
+ Traceback (most recent call last):
930
+ ...
931
+ SyntaxError: 'elif' block follows an 'else' block
932
933
Misuse of the nonlocal and global statement can lead to a few unique syntax errors.
934
935
>>> def f():
0 commit comments