Computer Science, asked by nagsushma13, 18 days ago

wap to enter a number and check whether its a 3 digit no. or not without using logical operator( and , or , not )​

Answers

Answered by Anonymous
1

n = int(input("Enter a number: "))

if ((str(len(n))) == 3):

print("It is a 3 digit number.")

else:

print("It is not a 3 digit number.")

________________________________

Alternate Program:

n = int(input("Enter a number: "))

if ((len(n)) + 1 == 3):

print("It is a 3 digit number.")

else:

print("It is not a 3 digit number.")

Similar questions