python program to input a single digit and print a 3 digit number

Programming Example

Write a program to input a single digit(n) and print a 3 digit number created as <n(n+1)(n+2)> e.g., if you input 7, then it should print 789. Assume that the input digit is in range 1-7.

Solution

n=int(input("Enter a digit in range 1-7 : "))
num=n*100+(n+1)*10+(n+2)
print(" New 3 Digit Number : ",num)
Output

Enter a digit in range 1-7 : 5

 New 3 Digit Number :  567