isdigit(): checking digits only in a string in Python
Use the isdigit() method to check if a string only contains digits. Digits include numbers from 0 to 9 and also superscripts and subscripts. word = '32' print(word.isdigit()) #output: True print("\u2083".isdigit()) #unicode for subscript 3 #output: True word = 'beach'…