0
list multiply
if you want to multiply the whole list by 3 what to do ex:Num(1,2,3,4) as input , if you want to multiply the list by two then op is 2,4,6,8
4 Answers
+ 1
I would pop the things then reappend then to the list after multiplying or make a for loop multiplying then and putting in the list
0
to multiply the list you can use something like:
multiplied_list = [i*2 for i in list]
you can also use any other operation, not just multiplication
0
do not do list*3... this will give u list, list, list
0
a = [1, 2, 3, 4]
b = [5, 6, 7, 8]
result = [num1*num2 for num1, num2 in zip(a,b)]
print('Multiplication result is: ', result)
You can read the full article here.....
https://programmersportal.com/how-to-multiply-two-lists-in-JUMP_LINK__&&__python__&&__JUMP_LINK/