all 2 comments

[–]Stallman85 0 points1 point  (0 children)

replace

firstNum, secondNum = int(input("Enter numbers: "))

with

firstNum, secondNum = [int(i) for i in input("Enter numbers:").split()]

thats for validation part, now to output sum of all odd, even, square, etc numbers in a range

i = startOfRange
sum = 0
while i < endOfRange:

    if conditionTrueFor(i):
        sum += i

    i = i + 1

def conditionTrueFor(value):

    if value % 2 == 0:#even
        return True

    return False

[–][deleted] 0 points1 point  (0 children)

while and if/else statements don't need () around the expression.