官术网_书友最值得收藏!

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 !
主站蜘蛛池模板: 邢台县| 洞头县| 象山县| 精河县| 富民县| 卓资县| 丰宁| 平遥县| 吉安县| 眉山市| 武威市| 永修县| 永州市| 宁晋县| 惠东县| 东海县| 惠来县| 康平县| 临朐县| 南阳市| 新宾| 同德县| 库尔勒市| 拉孜县| 嘉鱼县| 万全县| 冀州市| 霍山县| 七台河市| 富平县| 龙胜| 刚察县| 青铜峡市| 马边| 新晃| 娄底市| 南和县| 商都县| 武鸣县| 慈利县| 青浦区|