import random liste=[] anzahl=int(input("Anzahl:?")) modus=input("1=absteigend oder 2=aufsteigend") for t in range(anzahl): liste.append(random.randint(10,99)) print(liste) print() for d in range(anzahl-1): max=liste[0] maxindex=0 for k in range(anzahl-d): if modus=="1": if liste[k]>max: max= liste[k] maxindex=k else: if liste[k]