MCQs > IT & Programming > Python > Which snippet will return the list of all occurances of 'b' in a = ['a','b','c','b'] ?

Python MCQs

Which of the following snippets will return the list of all occurances of 'b' in a = ['a','b','c','b'] ?
 

 

Answer

Correct Answer: b = [item for item in a if 'b' in a]

Explanation:

Note: This Question is unanswered, help us to find answer for this one

Python Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

Python Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it