2026fa_cse160/lecture20261117/while/while05.py
2026-11-17 12:30:27 -05:00

26 lines
612 B
Python

print("Process list - minimal code")
names = [ "Harry", "Moe", "Katrina", "Colorado", "Shenanigans", "Tracey"]
counter = 0
print("\nThe length of the list is {}\n".format(len(names)))
while(counter < len(names) ):
print("Counter = ",counter)
print("names[{}] = {}\n".format(counter,names[counter]))
counter = counter + 1
print("Process list - sorted")
names.sort()
counter = 0 ;
print("\nThe length of the list is {}\n".format(len(names)))
while(counter < len(names) ):
print("Counter = ",counter)
print("names[{}] = {}\n".format(counter,names[counter]))
counter = counter + 1