+ 1

what is the difference between return and print function in python?

please answer should be in written by your own:)

24th May 2019, 5:11 PM
Abhinav_Sahni
Abhinav_Sahni - avatar
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
24th May 2019, 5:19 PM
Prince PS[Not_Active]
Prince PS[Not_Active] - avatar
+ 1
That aren't the same function at all ( and return is a key word, not a function)...
24th May 2019, 5:16 PM
Théophile
Théophile - avatar