본문 바로가기
IT World/Python

Python Training Day5. Functions

by 닷라인웨이 2022. 12. 16.

Chapter 8. Functions

 

Define functions

 

1. Functions in python are defined using the block keyword "def", followed with the function's name as the block's name. 

 

2. Functions may also receive arguments (variables passed from the caller to the function).

 

3. Functions may return a value to the caller, using the keyword- 'return' .

 

Call functions

 

Simply write the function's name followed by (), placing any required arguments within the brackets. 

 

Exercise 

learnpython.org

댓글