+ 1
What's an element
Connected to len
5 odpowiedzi
+ 1
Corrected
+ 1
In Python, with element you mean the comma "," separated things of the lists.
In list [6, 8, "dog", False]:
6, 8, "dog" and False are typically called elements or items.
len is a function, that counts the items in a list.
With len you need to remember, that lists can also be items of a list, and these inner lists are counted as 1 single items, no matter how many items they had.
print(len([1, False, ["KingKong", "Monkey", "Gorilla"]))
This would output: 3
+ 1
An element is another word for an item in a list. Len() is a function to get how many items are in a list
0
I don't understand you!
0
X = [2,3,4,5,6]
this list called X has 5 elements