Question: Python if the inputs to the function are [2, 3, 4] and 2, the function should return the list [4, 6, 8] a_list = [2,

Python

if the inputs to the function are [2, 3, 4] and 2, the function should return the list [4, 6, 8]

a_list = [2, 4 , 6]

factor_num = input('enter a number ')

def mult_list(a_list,factor_num):

result = factor_num

for x in a_list:

result = result * factor_num

print(mult_list(a_list))

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!