Es funktioniert soweit auch alles, bis auf einen Fehler ganz am Ende, sobald das Skript durchgelaufen ist.
Code: Alles auswählen
Traceback (most recent call last):
File "C:/Users/Stefan/Desktop/Python/asdasd.py", line 42, in <module>
loop3(x,y)
File "C:/Users/Stefan/Desktop/Python/asdasd.py", line 22, in loop3
print atoz[x] + atoz[x2] + atoz[x3]
IndexError: list index out of rangeDer Quellcode:
Code: Alles auswählen
atoz = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
x = 0
x2 = 0
x3 = 0
y = 25
def loop1(x, y):
while x<y:
print atoz[x]
x += 1
def loop2(x, y):
while x<y:
print atoz[x] + atoz[x2]
x += 1
def loop3(x, y):
while x<y:
print atoz[x] + atoz[x2] + atoz[x3]
x += 1
loop1(x,y)
x = 0
while x2<y:
loop2(x,y)
x2+=1
x = 0
x2 = 0
while x3<y:
while x2<y:
loop3(x,y)
x2+=1
if x2==y:
x2=0
x3+=1
