76.0k views
2 votes
You already know about lists. What missing function will return the index of 7 in the list? >>> myList = [12, 5, 7, 3, 25] >>> myList. (7)

2 Answers

9 votes

Answer:

index

Step-by-step explanation:

User Brian Barthold
by
2.9k points
9 votes

Answer:

The index function

Step-by-step explanation:

Required

What function is needed to complete the program

To return the index of an item in a list, we make use of the index function.

In this case, the complete program will be:

myList = [12, 5, 7, 3, 25]

print(myList.index(7))

At the end of program compilation and execution, the index of 7 (which is 2) will be returned/printed.

User Jhui
by
4.0k points