Standard LibraryTypesstringMethodsis_digitOn this pageis_digit Method of string. is_digit() -> bool Checks if the string consists only of digits.