0
Q:

python tuple to integer

# initialize tuple 
test_tuple = (1, 4, 5) 
  
# printing original tuple  
print("The original tuple : " + str(test_tuple)) 
  
# Convert Tuple to integer 
# Using int() + join() + map() 
res = int(''.join(map(str, test_tuple))) 
  
# printing result 
print("Tuple to integer conversion : " + str(res)) 
0
# Python3 code to demonstrate working of 
# Convert Tuple to integer 
# Using int() + join() + map() 
  
# initialize tuple 
test_tuple = (1, 4, 5) 
  
# printing original tuple  
print("The original tuple : " + str(test_tuple)) 
  
# Convert Tuple to integer 
# Using int() + join() + map() 
res = int(''.join(map(str, test_tuple))) 
  
# printing result 
print("Tuple to integer conversion : " + str(res)) 
0

New to Communities?

Join the community