items = []
items.append("apple")
items.append("orange")
items.append("banana")
# FAKE METHOD::
items.amount() # Should return 3
How do I get the number of elements in the list?
转载于:https://stackoverflow.com/questions/1712227/how-to-get-the-number-of-elements-in-a-list-in-python