We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 76ae393 commit 2294f2cCopy full SHA for 2294f2c
defining-functions.md
@@ -391,6 +391,29 @@ variable would be much more difficult. Printing things is fine when you
391
know that you'll only need to print the result and you'll never need to
392
assign it to a variable.
393
394
+So if our function returns a value we can use it like this:
395
+
396
+```py
397
+>>> def return_hi():
398
+... return "hi"
399
+...
400
+>>> print(return_hi())
401
+hi
402
+>>>
403
+```
404
405
+If the function prints instead we can call it and just throw away
406
+the None it returns:
407
408
409
+>>> def print_hi():
410
+... print("hi")
411
412
+>>> print_hi()
413
414
415
416
417
## Examples
418
419
Ask yes/no questions.
0 commit comments