-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.py
53 lines (46 loc) · 1.18 KB
/
functions.py
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# function = A block of reusable code
# place () after the function name to invoke it
# any data you send inside a function is called argument, but
# it needs a matching parameter
# def happy_birthday(name,age):
# print(f"Happy birthday to {name}!")
# print(f"You are {age} years old!")
# print("Happy birthday to you!")
# print()
#
# happy_birthday("Bro", 24)
# happy_birthday("Bro", 24)
# happy_birthday("Bro", 24)
# def display_invoice(username, amount, due_date):
# print(f"Hello {username}")
# print(f"Your bill of ${amount:.2f} is due: {due_date}")
#
# display_invoice("Acacia",32.41,"01/01")
# 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(1,2))
# print(subtract(1,2))
# print(multiply(1,2))
# print(divide(1,2))
def create_name(first, last):
first = first.capitalize()
last = last.capitalize()
return first + " " + last
full_name = create_name("acacia", "morningstar")
print(full_name)