-3

Create a function that checks if a number is a three digit number.

For example:

5.67 will be considered a three digit number 3.01 will be considered a three digit number 3.00 will not be cosidered a three digit number 0.123 will be cosidered a three digit number Call your function: three_digit()

I have already done some workenter image description here

General Grievance
  • 4,555
  • 31
  • 31
  • 45

1 Answers1

0

this is works:

def three_digit(num):
    if len(str(num).replace(".","").lstrip('0'))==3:
        return "YES"
    else:
        return "NO"
        
print(three_digit(1.234))
Innaz
  • 11
  • 3