use isdigit python code example Example 1: python isdigit my_char.isdigit() Example 2: python isdigit txt = "50800" x = txt.isdigit() print(x)