Skip to content

Commit 92bb905

Browse files
committed
Added some more examples
1 parent 8d8870b commit 92bb905

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

May21/functions/basics.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,37 @@ def say_hello():
1010
"""
1111
print("hello")
1212

13+
def pi():
14+
"""
15+
This function returns the pi value
16+
"""
17+
return 3.14
18+
19+
def square(number):
20+
"""
21+
This function returns the square of number
22+
23+
paramters:
24+
number:
25+
26+
returns:
27+
square of number
28+
"""
29+
return number ** 2
30+
31+
def power(number, index):
32+
"""
33+
This function can calculate the power
34+
"""
35+
return number ** index
36+
37+
# calling function
1338
say_hello()
1439
do_nothing()
1540
say_hello()
41+
# Getting a return value from function
42+
pi_value = pi()
43+
print(pi_value)
44+
print(square(10))
45+
print(power(10,4))
1646

0 commit comments

Comments
 (0)