+ 1
Hello can you help me calculate the sum of odd and even numbers using for loop?
I really need help
1 Respuesta
+ 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)