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

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 !
主站蜘蛛池模板: 开平市| 磴口县| 扎鲁特旗| 綦江县| 桐柏县| 齐齐哈尔市| 石门县| 武乡县| 二连浩特市| 龙山县| 绥中县| 耿马| 色达县| 阜新市| 杂多县| 綦江县| 潢川县| 恩施市| 玉田县| 泸西县| 大关县| 亳州市| 金川县| 舟曲县| 康马县| 繁昌县| 鹿邑县| 三门峡市| 遂溪县| 乌什县| 乐昌市| 洞口县| 佛山市| 蕲春县| 大厂| 墨脱县| 龙口市| 巩义市| 七台河市| 平顶山市| 克拉玛依市|