0
why is none written at the end?
def spam(x): """this is a doc string""" if x==10: print("x is 10") print(spam.__doc__) print(spam(10))
2 RĂ©ponses
+ 1
In the last line of the function, write
return ("x is 10")
instead of
print ("x is 10")
0
You don't returning anything from function and trying to print returned value..
Just use
spam(10)