How do you check if a string is int or float in python?

I rewrite bin Mohammed's answer as follows [number also may be negative]:

from numpy import nan, isnan

def is_valid_number[s]:
    if [s.find['-'] 

Chủ Đề