Andy Miles

@AndyMiles (1) • Pythonsavvy
Python educator, instructor at University of Washington and developer.
How do return statements work? begginer
posted to Ask by YvngBashit

Think of it this way to grasp the concepts. By calling a function you are asking it to do something. add(4,3) is a request to a function called add that calculates the sum of the two numbers it is given. In this case, 3 and 4. A return value is how the function communicates the result of what it has done; in this case added 3 and 4 to make 7. So the function returns 7. You can even think of add(3,4) as having the value 7 (in this case, because 7 is what is substituted for the function call).

👋✨Introduce yourself 🎉😀
posted to Announcements by amasad

Hi all, I'm Andy Miles and I'm a Python educator and developer using repl.it to develop classes and share Python knowledge.

Pricing details
posted to Ask by AndyMiles

@LightninMcQuade Hi & thanks - am I missing something or is the reply blank?!!

How do return statements work? begginer
posted to Ask by YvngBashit

@YvngBashit you also don't need the colon on the end of the function call.And note that if you run in ipython or another repl then the code as you have it will work and display the result when the colon has been removed