-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunction.py
More file actions
36 lines (36 loc) · 1.04 KB
/
Copy pathfunction.py
File metadata and controls
36 lines (36 loc) · 1.04 KB
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
#function = A block of reusable code
# place() after the function name to invoke it
# def happy_birthday(name,age):
# print(f"Happy birthday to {name}")
# print(f"You are {age} old")
# print("Happy Birthday to you")
# print()
# happy_birthday("palak",19)
# def display_invoice(username,amount,duedate):
# print(f"Hello{username}")
# print(f"your bill of ${amount:.2f} is due: {duedate}")
# display_invoice("loe",100.01,"01/04")
######################### return = statement used to end a function and send a result back to the caller
# def add(x,y):
# z = x+y
# return z
# def subtract(x,y):
# z=x-y
# return z
# def multiply(x,y):
# z=x*y
# return z
# def divide(x,y):
# z=x/y
# return z
#
# print(add(3,4))
# print(subtract(5,2))
# print(multiply(3,2))
# print(divide(4,2))
# def create_name(first,last):
# first = first.capitalize()
# last = last.capitalize()
# return first + " " + last
# full_name = create_name("bro","Code")
# print(full_name)