B03B-2017D – Computer Sir Ki Class

Login


Lost your password?

Don't have an account ?
Register (It's FREE) ×
  

Login
[lwa]



Exam Questions-CBSE12D-2017-B03B #PYTHON#6420    siteicon   siteicon  

Problem Statement - B03B-2017D

Write definition of a method OddSum(NUMBERS) to add those values in the list of NUMBERS, which are odd.

Solution

TC++ #6420

def OddSum(NUMBERS):
    n=len(NUMBERS)
    s=0
    for i in range(n):
        if (i%2!=0):
            s=s+NUMBERS[i]
    print(s)


Share

CSKC| Created: 12-Jan-2019 | Updated: 12-Jan-2019|CBSE12D-2017









Back