-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfunctions.py
More file actions
34 lines (25 loc) · 720 Bytes
/
Copy pathfunctions.py
File metadata and controls
34 lines (25 loc) · 720 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
#type(),print(), etc. -built in function-
# our own custom made functions -user defined functions-
#print(type(greet)) #it gives an error because we didnt defined its content.
def greet():
print("say hi")
print("How are you?")
print(type(greet))
greet() #call function
#parameters and arguments
def greet(name):
print("your name is",name)
greet("aysu")
def addition(a,b,c):
print("sum =", a+b+c)
addition(3,4,5)
def factorial(number):
factorial=1
if(number == 0 or number ==1 ):
print("factorial = ",factorial)
else:
while(number >= 1):
factorial *= number
number -= 1
print("factorial = ",factorial)
factorial(5)