Python Write a code that takes two integers to obtain an odd sum and an even sum between two numbers

Asked 2 years ago, Updated 2 years ago, 15 views

sum=0
a=int (input ("first integer : ")))
b=int (input ("second integer : ")))
if a % 2 ==0 :       
    for i in range(a,b) :        
else:
    print("even sum:",a)
if a % 2 == 1 :
    for i in range(a,b)
else:
    print("odd sum: "", b)

I need to enter two integers as in the title and find the odd sum of the two numbers, but I'm not sure. Please advise.

python

2022-09-20 20:01

1 Answers


2022-09-20 20:01

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.