📌  相关文章
📜  如何在python代码示例中将元组转换为int

📅  最后修改于: 2022-03-11 14:46:56.446000             🧑  作者: Mango

代码示例1
# 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))