Write a Python program that accepts an integer (n) and computes the value of n+nn+nnn.

Program


def myfun():
   x = int(input("Input an integer: "))
   n1 = int("%s" % x)
   n2 = int("%s%s" % (x, x))
   n3 = int("%s%s%s" % (x, x, x))  
   print(n1 + n2 + n3)
      
if __name__=="__main__":      
    myfun()

Output:

Input an integer: 6
738


Input an integer: 5
615
For latest job updates join Telegram Channel: https://t.me/sateeshm

Programs