Avatar ·

Split-Methode in Python

📁 Python, Beispiel, Arbeit

Code:


a = input().split()
print(a)

Bei Eingabe der Zeile '1 2 3'


Traceback (most recent call last):
  File "", line 1, in <module>
    a = input().split()
  File "", line 1
    1 2 3
    ^
SyntaxError: invalid syntax

Woran könnte das liegen?