How to divide each element in a tuple by a single integer?
Basically the same as this answer by Truppo.
>>> t = (10,20,30)
>>> t2 = tuple(ti/2 for ti in t)
>>> t2
(5, 10, 15)
may be you could try if is a numbers tuple:
numberstuple = (5,1,7,9,6,3)
divisor= 2.0
divisornodecimals = 2
value = map(lambda x: x/divisor, numberstuple)
>>>[2.5, 0.5, 3.5, 4.5, 3.0, 1.5]
valuewithout_decimals = map(lambda x: x/divisornodecimals, numberstuple)
>>>[2, 0, 3, 4, 3, 1]
or
value = [x/divisor for x in numberstuple]