Closed Casper17-max closed 3 years ago
Hi Casper,
It seems that you are simply printing a function. Note that your function is taking a argument y. Try and print your function while also specifying the argument (like: print(my_fun(y))).
Best, Joachim
Thank you, that helped :-)
Hi Joachim,
I have played a bit around with defining variables with and without 'print'. I seem to come to the conclusion that the print-function simply returns 'None'. Hence, the above code simply defines answer_032a=answer_032b=None.
Is my observation correct, or am I missing something? (the below picture illustrates what i have "found")
Hi Johan
My experience is that you should generally not define any variables the following way:
y = print(2*x)
Always do the following:
y = 2*x
print(y)
That is, don't generally create a new object from print()
. In general, only use print()
when you have a personal desire to understand what is going on with your code. Does that make sense?
Best, Joachim
Hi Joachim,
Thanks for the answer.
It makes perfect sense. It is exactly what i thought.
/Johan
Jeg forstår ikke hvad problemet er i 'in [21]:'