I didn't really understand the difference between return and print, so I'll summarize them here. However, I haven't completely grasped the difference yet, so I hope I can clearly understand the difference.
** return ** = In the function, return the value to the caller. I made a mistake, but return returns a value, so if you want to output a value, you have to use print. ** print ** = Just print a string. It is used not only in functions but also in various situations. If you want to output the value returned by return, you cannot display it unless you output it by print.
I understand it somehow, but I still don't understand the "returning value" part of return. I hope I can write the code many times from now on, and read the code written by others and understand it clearly.
Recommended Posts