-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions.py
More file actions
executable file
·36 lines (22 loc) · 837 Bytes
/
functions.py
File metadata and controls
executable file
·36 lines (22 loc) · 837 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
""""
There are tow types of functions:
1- built-in functions
2- user-defined functions
built-in functions are already made for you and ready for use
user-defined functions are left for you to define them according to your need
THE SYNTAX FOR DEFINING USER-DEFINED FUNCTIONS IS:
def function_name():
statements
where function_name is the name of the function you wanna name it for example:
def hello():
print("Hello World")
"""
# function without parameter
def function_name():
print("I'm function without parameter")
# function with one parameter (you can pass many parameters to the function as you want)
def function_name1(param):
print(f"I'm a function with {param} parameter")
# calling function (without calling functions have no effects)
function_name()
function_name1("one")