Lecture 11/17/2026
This commit is contained in:
parent
07b9e54bf0
commit
bf3265103a
44 changed files with 1195 additions and 3 deletions
26
lecture20261117/while/while05.py
Normal file
26
lecture20261117/while/while05.py
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
|
||||
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue