Skip to content

Commit 1e04f4f

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 6716e4d commit 1e04f4f

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

other/functions.py

+11-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
A pure Python implementation of Functions
2+
A pure Python implementation of Functions
33
44
A Function in python is a reusable piece of code that takes N parameters and can be called as many times as we want.
55
Functions are important because:
@@ -10,10 +10,11 @@
1010
1111
"""
1212

13-
def addition(a ,b):
13+
14+
def addition(a, b):
1415
"""
1516
A function in python is created with a keyword 'def' in all small , followed with the name of the function for example in here addition
16-
and in the brackets we pass on the parameter's value the function will work upon
17+
and in the brackets we pass on the parameter's value the function will work upon
1718
1819
"""
1920
return a + b
@@ -23,11 +24,12 @@ def addition(a ,b):
2324
2425
"""
2526

26-
print(addition(4,5))
27+
28+
print(addition(4, 5))
2729

2830
"""
2931
To call a function you type in the function's name and pass on the values that you want your function to pass
30-
For example : Result for this case will be 9 as 4 + 5 here automatically the function assumes a = 4 and b = 5
32+
For example : Result for this case will be 9 as 4 + 5 here automatically the function assumes a = 4 and b = 5
3133
another way to call a function is to specify the values for example print(addition(a=4 ,b= 5))
3234
3335
"""
@@ -40,13 +42,16 @@ def addition(a ,b):
4042
4143
"""
4244

45+
4346
def each_item_in_list(list):
4447
for item in list:
4548
print(item)
4649
"""
4750
Here the function takes takes the parameter 'list' and this function when called upon will print every item of the list
4851
"""
49-
each_item_in_list([1,2,3,4,5,6])
52+
53+
54+
each_item_in_list([1, 2, 3, 4, 5, 6])
5055

5156
"""
5257
Upon calling the function the result will be

0 commit comments

Comments
 (0)