Übung27.py - Übung 27 z = int(input"Geben ein länge = Leere Liste wird erstellt while z!= 1 if z 2!= 0 z = 3 z 1 länge.append(z#der leeren Liste

# Übung27.py - Übung 27 z = int(input"Geben ein länge =...

• 1

This preview shows page 1 out of 1 page.

# Übung 27 z = int(input("Geben ein: ")) länge = [] # Leere Liste wird erstellt while z != 1: if z % 2 != 0: z = 3 * z + 1 länge.append(z) #der leeren Liste wird der Wert z hinzugefügt else: z = 0.5 * z länge.append(z) #der leeren Liste wird der Wert z hinzugefügt print(int(z)) #print(länge) #print(len(länge)) länge.sort() # die Liste länge wird aufsteigend sortiert [5,3,1,2] -> [1,2,3,5] maxi= len(länge) # maxi wird dem Wert der länge der Liste zugewissen beim bsp oben = 4 print("Das Maxiumum ist: " + str(länge[maxi-1])) # Ausgabe des Maximum, da die

#### You've reached the end of your free preview.

Want to read the whole page?

• Winter '17

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern