Python Programming - Variables - Discussion

Discussion Forum : Variables - General Questions (Q.No. 18)
18.
Which of the following is a valid way to check if a value is in a list called my_list?
if my_value in my_list
if my_list[ my_value ]
if my_value in my_list == True
All of the above
Answer: Option
Explanation:
In Python, the in and not in operators can be used to check if a value is or is not in a list, respectively.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.