Functions · 13 / 27 Exercise Medium

Check numeric string

Objective

Create a Python program with a function called is_number() that receives a text and determines whether it represents a number or not.

Instructions

  • Implement the function is_number() with a text parameter.
  • The function checks whether the text represents a number. If it does, it returns True; otherwise it returns False.
  • It must work with different kinds of numbers, including integers and decimals.
Input
234
Output
True

Open the editor in full screen: the statement on the left and your code, the output and the tests on the right.

Start exercise