+ 1
What's wrong with this 3 lines?
When i define a function like this: def func1(x,y): print(x-2*y) print(func1(6,2)) it gives as output: 2 None My question is, what is this none ans where did it came from?
4 Antworten
+ 1
func1 does not retun , inside it you print 6-2*2 ,then you print None.
Just call func1(6,2) or modify to return x-2*y
def func1(x,y):
return x-2*y
print(func1(6,2))
or
def func1(x,y):
print(x-2*y)
func1(6,2)
+ 1
I see now! Such a dumb mistake...
Thank you so much Szabó!!
+ 1
I didn't quite mean that AG, I was talking about the "None" output