+ 1
what is the difference between return and print function in python?
please answer should be in written by your own:)
3 Answers
+ 6
Well my answer is that print is a 5 letter world and return is a 6 letter world.đ
Print :
well print statement is used to give some common output or to show anything on the screen after execution.
It consists of 2 braces i.e.() that's why it is also a function.
It's syntax :
print("Hii")
Output
Hii
------------------------------------------
Return :
return statement is used to give output just inside a function .
Return has several properties
Such as it's the last line that is executed in the function
No line after it is executed.
It is not a function and it doesn't require ()braces.
It's syntax
return 4
Output :
4
--------------------
Thanks
+ 1
That aren't the same function at all ( and return is a key word, not a function)...