18 lines
438 B
Python
18 lines
438 B
Python
#!/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))
|