Python-Quizzes | Python List Quiz | Question 7

Question: 7 Find the output of the following program:

filter_none

edit
close

play_arrow

link
brightness_4
code

# statement 1
list1 = range(100, 110
  
# statement 2
print (list1.index(105))

chevron_right


(A) 105
(B) 5
(C) 106
(D) 104


Answer: (B)

Explanation: Statement 1: will genetrate numbers from 100 to 110 and appent all these numbers in the list.
Statement 2: will give the index value of 105 in the list list1.

Quiz of this Question

My Personal Notes arrow_drop_up
Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.