+1 vote
in Class 10 by kratos

Kritika was asked to accept a list of even numbers but she did not put the relevant condition while accepting the list of numbers. You are required to write a user defined function oddtoeven(L) that accepts the List L as an argument and convert all the odd numbers into even by multiplying them by 2 .

1 Answer

+5 votes
by kratos
 
Best answer

def oddtoeven(L) :

for i in range (len (L)):

if (L[i]%2! = 0):

L[i] = L[i]*2

...