How to multiply the elements of a tuple by specific number in Python

1 Answer

0 votes
import math

tpl = (5, 9, 3, 1, 89, 250)

tpl = tuple(3 * element for element in tpl)

print(tpl) 
 
   
   
   
'''
run:
   
(15, 27, 9, 3, 267, 750)
 
'''

 



answered Jul 24, 2022 by avibootz

Related questions

1 answer 137 views
1 answer 119 views
1 answer 140 views
1 answer 173 views
...