MCQs > IT & Programming > Python > Which is the best way of checking if a string could be represented as a number?

Python MCQs

Which of the following is the best way of checking if a string could be represented as a number?

Answer

Correct Answer: def is_number(s): try: float(s) return True except ValueError: return False

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

More Python MCQ Questions

search

Python Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it