69.4k views
3 votes
What missing function will return the index of 7 in the list?

What missing function will return the index of 7 in the list?-example-1
User Emilmont
by
6.0k points

2 Answers

2 votes

Answer:

Index

Step-by-step explanation:

Edge 2020

User Jornane
by
5.5k points
4 votes

Answer:

The answer is: index function and it will be used in the following manner:

>>> myList.index(7)

Step-by-step explanation:

List is one of the 4 built-in data types that are present in Python language. Lists are used to store same type of values. Indexes are used to access elements of lists in Python.

Various operations can be performed on the lists.

In the given question, we have to write the function that can be used to find the index of an element in the list.

Index function is sued for this purpose.

The syntax for index function is:

list_name.index(element)

So for the given list, to find the index of 7, the function will be written as:

>>> myList.index(7)

Hence,

The answer is: index function and it will be used in the following manner:

>>> myList.index(7)

User Gauravmehla
by
6.0k points