-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunc.py
More file actions
39 lines (30 loc) · 661 Bytes
/
func.py
File metadata and controls
39 lines (30 loc) · 661 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
37
38
39
'''def add(a,b):
return (a+b)
sum = add(4,5)
print(sum)
def student(name):
return f"Hello , {name}"
print(student("zakir"))
#area of square
import math as m
area= m.pi*m.pow(5,2) #pow-->power contains base and exponent
print(area)'''
#functions with inputs
def greet(name):
return f"hello! {name}"
print(greet("zakir"))
def add(a,b):
return (a+b)
print(add(60,80))
def area(a,b):
return a*b
print("Area of rectangle: ",(area(4,6)))
def greet(name="Guest"):
print(f"Welcome, {name}!")
greet()
greet("Zakir")
def print_item(items):
for item in items:
print("-", item)
colors=["red", "green", "blue"]
print_item(colors)