Enter a single digit and convert into 3 digit number in python


Write a program in python to enter any single digit number and convert it, into 3 digit number.

n=int(input("Enter the digit in range 1-7: "))
num=n*100+(n+1)*10+(n+2)
print("The three digit number formed: ",num)

Output:-

Enter the digit in range 1-7: 6

The three digit number formed : 678


Post a Comment

0 Comments