0 votes
in Python by
What are the functions in Python?

2 Answers

0 votes
by
In Python, functions are defined as a block of code that is executable only when it is called. The def keyword is used to define a function in Python.

Example:

1

2

3

def Func():

print("Hello, Welcome toMadanswer")

Func(); #calling the function

Output: Hello, Welcome to Madanswer
0 votes
by

Functions in Python refer to blocks that have organised, and reusable codes to perform single, and related events. Functions are important to create better modularity for applications which reuse high degree of coding. Python has a number of built-in functions like print(). However, it also allows you to create user-defined functions.

Related questions

0 votes
asked Dec 14, 2019 in Python by sharadyadav1986
+1 vote
asked Feb 14, 2021 in Python by SakshiSharma
...