Added lecture 2026113
This commit is contained in:
parent
be356ccb59
commit
5b630435ae
27 changed files with 738 additions and 0 deletions
27
lecture20261103/lists01/list03.py
Normal file
27
lecture20261103/lists01/list03.py
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
|
||||
|
||||
myList = [ 7, 5, 3, 9,11]
|
||||
|
||||
|
||||
print("The list is ",myList)
|
||||
print("The type is ",type(myList))
|
||||
print("The length is ", len(myList) )
|
||||
print("\n")
|
||||
|
||||
for dummy in myList:
|
||||
print(f"{dummy:3d} {dummy**2:4d} {dummy**3:5d}")
|
||||
|
||||
print("Done!")
|
||||
for listElement in myList:
|
||||
print(f"{listElement:3d} {listElement**2:4d} {listElement**3:5d}")
|
||||
|
||||
print("Done!")
|
||||
|
||||
for x in myList:
|
||||
print(f"{x:3d} {x**2:4d} {x**3:5d}")
|
||||
|
||||
print("Done!")
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue