a=int(input("Enter the number- ")) n1=int("%d"%a) n2=int("%d%d"%(a,a)) n3=int("%d%d%d"%(a,a,a)) print(n1) print(n2) print(n3) print ("Sum- ",n1+n2+n3)
Quote:n2=int("%d%d"%(a,a))
a
2
a = 10 => n2 = 1010
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)