Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

convert tuple to int

# Using reduce() + lambda

import functools
  
my_tuple = (1, 4, 5)
  
res = functools.reduce(lambda sub, ele: sub * 10 + ele, my_tuple)
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #convert #tuple #int
ADD COMMENT
Topic
Name
1+8 =