Mahlzeit!! folgendes snippet: -------------------------8<-----------------
zeile = []
zeile.append() = ef.read() # einlesen aller Elemente a = len(zeile) b = zeile.count("\n") if a == 0: print("nix gelesen!") exit()
for i in range (1,a) : if zeile[i] != "\n": continue if zeile[i] =="\n" and i % 4 ==0: continue else: zeile[i] = "," ----------------------------8<-----------------
zuerst wird eine Liste erzeugt, weil ich einen mutable sequentiellen Datentyp brauche. Im letztem statement kommt ein Error:
1 |
|
zeile wird eingentlich als list erwartet, aber als string geliefert, der unmutable ist.
Ich bin derzeit ratlos. Kann jemand weiter helfen?
Gruss
Robert