Header Ads Widget

Python program to convert elements of tuple in to integer.

 original tuple=(1,2,3,4)

output=1234

 Code:-


mytuple=(1,2,3)
num=0
for i in mytuple:
num=num*10+i
print(num)

Output:-


123



Post a Comment

0 Comments