MCQs > IT & Programming > Python > Best way to check if the object 'myobject' is iterable in Python?

Python MCQs

What is the best way to check if the object 'myobject' is iterable in Python?

Answer

Correct Answer: try: [ e for e in myobject] except TypeError: print myobject, 'is not iterable'

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