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


Introduction

Write a Python program that accepts an integer (n) and computes the value of n+nn+nnn. I have used python 3.7 compiler for debugging purpose.


techstudy.org

HP 15 Core i3 7th gen Laptop(4GB, 1TB HDD, Windows 10) | Rs. 31,490

  1. a = int(input("Input an integer : "))
  2. num1 = int( "%s" % a )
  3. num2 = int( "%s%s" % (a,a) )
  4. num3 = int( "%s%s%s" % (a,a,a) )
  5. print (num1+num2+num3)
  6.  

Result

python language techstudy.org

     





Related Topics




Popular Posts