Computer Science, asked by Vishal3628, 1 day ago

write a program to input a number and find out if it is single digit or double digit number display ​

Answers

Answered by pwrepigami
1

Answer:

i = int(input("Enter a Number:")

if len(i) == 0:

   print("it is a one digit number")

if len(i) == 1:

   print("it is a two digit number")

else:

   print("it is larger than two digits")

Explanation:

it is made in python

Answered by purveshKolhe
5

\huge{\green{\underbrace{\overbrace{\blue{\mathfrak{answer::}}}}}}

-------------------------------

\red{\bf{\underline{The\:program\:is\:in\:Python}}}

x = int(input())

if len(str(x)) == 1:

  print("Single digit")

elif len(str(x)) == 2:

  print("Double digit")

else:

  print("Multi-digit")

_________________________

\large{\red{\mathfrak{Logic::}}}

  • We took input in variable x.
  • Then converted x to string.
  • Found length of the variable.
  • And printed the output using if-elif-else statements.
  • Andd... it is finished.

--------------------------------

Hope it helps...

--------------------------------

Similar questions