0
def print even?
whenever i hit run for this code I get no none how do i get rid of the none underneath no def even (x): if x % 2 == 0: print ("yes") else: print ("no") print (even(5)) no none
3 ответов
+ 3
change "print(even(5))" to "even(5)"
+ 2
Your code does not return any value, to solve it do what I×Am×Idiot says, I recommend the following way:
def even (x):
return "yes" if x%2 == 0 else "no"
print (even (4))
print (even(5))
0
ty so much