Python Basics (II)

An operation of the digital

  • Determining whether a function is digital
  1. isdigit ()

to true: bytes digital, full-width (double-byte) numbers, Roman numerals, Unicode numbers

false: digital characters, such as a.

  • = NUM INPUT ( "Enter a number:") IF isdigit (NUM): NUM = int (NUM) the else : frint ( " Enter a number: ' )

Guess you like

Origin www.cnblogs.com/gjx1212/p/11531119.html