0

instead of "odd or even" function i used a remainder of 2 to define the condition

def remainder_2 (c): assert c >= 0 assert round (c) == c if c%2 == 0: print ("even number") else: print ("odd number") print (remainder_2(10)) print (remainder_2(29)) """result kept coming with "None"statement

26th Nov 2018, 9:35 AM
umar
1 Answer
+ 6
Either call the function without passing it as print() function argument e.g. remainder_2(10) Or, you can change the lines that calls print() function to return the string you want instead, e.g. if c % 2 == 0: return "Even number" else: return "Odd number" And you can pass it to print() function as you did before: print(remainder_2(10))
26th Nov 2018, 9:42 AM
Ipang