Added code for lecture 2026-11-10
This commit is contained in:
parent
5b630435ae
commit
07b9e54bf0
52 changed files with 1248 additions and 1 deletions
17
lecture20261110/lists/list01.py
Normal file
17
lecture20261110/lists/list01.py
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
#!/usr/bin/python3
|
||||
# Program: list01
|
||||
|
||||
# Defining and printing list lengths.
|
||||
|
||||
# Lists of text values
|
||||
dogNames = [ "Harry", "Shenanigans","Katrina","Tanner","Yukon Jack", "Colorado","Mandy"]
|
||||
|
||||
# Lists of numbers. These could be integers or floats.
|
||||
intList = [7, 2, 12, 18, 16, 21]
|
||||
|
||||
|
||||
|
||||
# Print the list and the length
|
||||
print("Print the length of the lists.")
|
||||
print (dogNames," length = ",len(dogNames))
|
||||
print(intList," length = ",len(intList))
|
||||
Loading…
Add table
Add a link
Reference in a new issue