- Mastering Python Scripting for System Administrators
- Ganesh Sanjiv Naik
- 75字
- 2021-07-02 14:00:29
Functions
A function is a set of statements that perform a specific task. Using functions helps in breaking our program into smaller parts. Programs will be more organized if we use functions as it avoids repetition and makes code reusable. Look at the following syntax:
def function_name(parameters):
statement(s)
Refer to the following example:
def welcome(name):
print("Hello " + name + ", Welcome to Python Programming !")
welcome("John")
Output:
Hello John, Welcome to Python Programming !
推薦閱讀
- Windows系統管理與服務配置
- Mastering QGIS
- Python Deep Learning
- C語言最佳實踐
- FLL+WRO樂高機器人競賽教程:機械、巡線與PID
- 區塊鏈技術進階與實戰(第2版)
- 零基礎學編程系列(全5冊)
- Java程序設計
- Building Microservices with Go
- Go語言編程之旅:一起用Go做項目
- Unity與C++網絡游戲開發實戰:基于VR、AI與分布式架構
- Daniel Arbuckle's Mastering Python
- 瘋狂Ajax講義(第3版)
- Oracle API Management 12c Implementation
- Hands-On Exploratory Data Analysis with Python