+ 1

Hello can you help me calculate the sum of odd and even numbers using for loop?

I really need help

10th Aug 2018, 9:18 AM
Keyt Monroe
Keyt Monroe - avatar
1 Answer
+ 1
I think this is what you need evenSum = 0 oddSum = 0 for x in range(10): if x%2 == 0: evenSum += x else: oddSum += x print(oddSum) print(evenSum)
10th Aug 2018, 9:23 AM
Mootin Man
Mootin Man - avatar