181k views
4 votes
MyLIst = [1, 2, 45, 66, 77, 88]

White the line of code which will find the number of elements in myList and save the value in countElements. (Python)

MyLIst = [1, 2, 45, 66, 77, 88] White the line of code which will find the number-example-1
User TVK
by
7.5k points

1 Answer

3 votes

Answer:

Here's the line of code to find the number of elements in myList and save the value in countElements:

_______________________

|python

countElements = len(myList)

The len() function in Python returns the number of elements in a list, and we can assign the result to a variable countElements using the assignment operator =.

User Xzin
by
6.7k points