53GB

Functions in Python are easy ๐Ÿ“ž



Functions in Python are easy ๐Ÿ“ž

#python #tutorial #course

00:00:00 functions
00:01:49 arguments
00:04:28 exercise #1
00:06:12 return
00:08:27 exercise #2
00:10:08 conclusion

# โ€”โ€”โ€”- EXAMPLE 1 โ€”โ€”โ€”-
def display_invoice(username, amount, due_date):
print(fโ€Hello {username}โ€)
print(fโ€Your bill of ${amount:.2f} is due: {due_date}โ€)

# display_invoice(โ€œBroCodeโ€, 42.50, โ€œ01/02โ€)
# display_invoice(โ€œJoeSchmoโ€, 100.99, โ€œ02/03โ€ณ)

# โ€”โ€”โ€”- EXAMPLE 2 โ€”โ€”โ€”-
def create_name(first, last):
first = first.capitalize()
last = last.capitalize()
return first + โ€ โ€ + last

full_name = create_name(โ€œspongebobโ€, โ€œsquarepantsโ€)
print(full_name)

Exit mobile version