programming-examples/python/_Basics/Input an integer (n) and computes the value of n+nn+nnn.py

5 lines
147 B
Python
Raw Normal View History

2019-11-15 12:59:38 +01:00
a = int(input("Input an integer : "))
n1 = int( "%s" % a )
n2 = int( "%s%s" % (a,a) )
n3 = int( "%s%s%s" % (a,a,a) )
print (n1+n2+n3)