Wie zu Lesen, formatierte Eingaben in python?

Ich soll von stdin Lesen fünf Nummern wie folgt eingetragen:

3, 4, 5, 1, 8

in einzelne Variablen a,b,c,d & e.

Wie mache ich das in python?

Habe ich versucht, dieses:

import string
a=input()
b=a.split(', ')

für zwei ganze zahlen, aber es funktioniert nicht. Ich:

Traceback (most recent call last):
  File "C:\Users\Desktop\comb.py", line 3, in <module>
    b=a.split(', ')
AttributeError: 'tuple' object has no attribute 'split'

Wie dies zu tun? und nehme an, dass ich nicht eine Feste, sondern eine variable Anzahl n ganze zahlen. Dann?

InformationsquelleAutor Lazer | 2009-09-09
Schreibe einen Kommentar