KnowledgeBoat Logo

Computer Science

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

Python

Python Funda

79 Likes

Answer

d = int(input("Enter a digit in range 1-7: "))
n = d * 10 + d + 1
n = n * 10 + d + 2
print("3 digit number =", n)

Output

Enter a digit in range 1-7: 7
3 digit number = 789

Answered By

44 Likes


Related Questions