Computer Science, asked by priyanka6254, 3 months ago

wap to input a number and check the is one digit, two digit, three digit, or more than three digit number ​

Answers

Answered by jai696
2

\huge\red{\mid{\fbox{\tt{Using\: Python\: 3}}\mid}}

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: ")))))

\large\mathsf\color{lightgreen}useful?\: \color{white}\longrightarrow\: \color{orange}brainliest!

Answered by Japji21
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