151k views
2 votes
How many passes will it take to find the 20 in this list? (python)

10, 12, 14, 16, 18, 19, 20

3

1

2

4

2 Answers

3 votes

Answer:

1

Step-by-step explanation:

What do you mean by a pass? A pass through each number in the list?

for x in numLst:

if x == 20:

return True

This would run through the list once, as you're just checking if each element is 20 in this loop.

User Guillermo Garza
by
6.0k points
6 votes

Answer:

2

Step-by-step explanation:

on edge right

User Doug Allrich
by
5.4k points