Fehler

Syntaxfehler

In [1]:
while True print("Hello world")
  File "<ipython-input-1-250f27461786>", line 1
    while True print("Hello world")
                   ^
SyntaxError: invalid syntax
In [2]:
while True and print("Hello world")
  File "<ipython-input-2-999e1ea49352>", line 1
    while True and print("Hello world")
                                       ^
SyntaxError: invalid syntax
In [3]:
while True and None
  File "<ipython-input-3-18d27a539306>", line 1
    while True and None
                       ^
SyntaxError: invalid syntax
In [4]:
while True and None:
    print("Hello world")
In [5]:
while True and print("Hello world"):
    print("andere Welt")
Hello world
In [6]:
while True and not print("Hello world"):
    print("andere Welt")
    break
Hello world
andere Welt

Einrückungsfehler

In [7]:
if 1 < 2:
print("Stimmt")
  File "<ipython-input-7-86300011e25f>", line 2
    print("Stimmt")
        ^
IndentationError: expected an indented block