[Tutor] Requesting help

Dennis Lee Bieber wlfraed at ix.netcom.com
Sun Apr 3 14:38:45 EDT 2022


On Sun, 3 Apr 2022 11:20:32 -0500, Eleejay 1O1 <luigimanpeach12 at gmail.com>
declaimed the following:

>
>I'm currently enrolled in the Python Programming course with Google. And
>I'm trying to understand returning values and returning values using
>functions. I do understand the role of functions, however, the use of
>return using functions throws me off. Can you help me with this?
>

	Since I don't know of any means of "returning values" that does not use
a function, your situation is unclear to me. I'm also not going to register
for some Google "course" just for a one-time question.

	Pretty much by definition, a function accepts one or more arguments,
does some computation using those arguments, and returns the result of the
computation as the function value. (Some languages differentiate functions
returning values from procedures which do not -- those languages often,
however, allow side-effects in that arguments to the procedure can be
changed within it, and the changes become visible in the caller; Python
does not -- if one does not explicitly return a value, the language returns
the None object, and if one does not "capture" the return it falls into a
bit-bucket)

def afunc(a, b):
	avalue = math.sin(a) / b
	return avalue

value = afunc(2.78, 3.14)



-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
	wlfraed at ix.netcom.com    http://wlfraed.microdiversity.freeddns.org/



More information about the Tutor mailing list