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))

27th Jan 2022, 11:16 AM
NIKHIL
2 RĂ©ponses
+ 1
In the last line of the function, write return ("x is 10") instead of print ("x is 10")
27th Jan 2022, 12:52 PM
𝑹𝒍𝒗𝒊𝒏
𝑹𝒍𝒗𝒊𝒏 - avatar
0
You don't returning anything from function and trying to print returned value.. Just use spam(10)
27th Jan 2022, 11:22 AM
Jayakrishna 🇼🇳