wap to input a number and check the is one digit, two digit, three digit, or more than three digit number
Answers
Answered by
2
def digits_len(n):
digits_str_len = len(str(n))
if digits_str_len == 1:
return "one digit"
if digits_str_len == 2:
return "two digits"
if digits_str_len == 3:
return "three digits"
return "more than three digits"
print(digits_len((n := int(input("enter num: ")))))
Answered by
0
Answer:
def digits_len(n):
digits_str_len = len(str(n))
if digits_str_len == 1:
return "one digit"
if digits_str_len == 2:
return "two digits"
if digits_str_len == 3:
return "three digits"
return "more than three digits"
print(digits_len((n := int(input("enter num: ")))))
Similar questions
English,
1 month ago
Social Sciences,
1 month ago
Chemistry,
3 months ago
Math,
3 months ago
Physics,
9 months ago