Computer Science, asked by vasugoel2772, 2 months ago

SPAM WILL BE REPORTED

PLZ HELP,

WAP in python enter 10 numbers in a tuple from keyboard, then display sum of all negative odd numbers.​

Answers

Answered by Anonymous
2

nums= input("Input 10  comma separated numbers : ")

neg_odd=0

list = nums.split(",")

tup = tuple(list)

tup=[int(i) for i in tup]

print(tup)

for j in tup:

if j<0 and j%2!=0:

 neg_odd+=j

           

print('sum of all negative odd integers is',neg_odd)

Similar questions