r/AskProgramming • • Jun 05 '26

Help beginner

What is difference between output and return. I have seen some videos and it says like return is for computer and output is for human. Is it like two seperate ways one is displayed and one is stored? If so then wouldn't it become same like a stored variable?

1 Upvotes

15 comments sorted by

View all comments

Show parent comment

1

u/AFK_MIA Jun 05 '26

Yes, I think you've got it - except at the very end. print(x) doesn't change the value of x if it's passed as an argument to the function. if the line were x = print(x), then x would get changed to None since print doesn't return a value, but it would print the number 5 to the terminal.