write a program to input a number and find out if it is single digit or double digit number display
Answers
Answered by
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
5
-------------------------------
x = int(input())
if len(str(x)) == 1:
print("Single digit")
elif len(str(x)) == 2:
print("Double digit")
else:
print("Multi-digit")
_________________________
- 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
Computer Science,
16 hours ago
Hindi,
1 day ago
Computer Science,
1 day ago
Math,
8 months ago
Math,
8 months ago