Functions in Python are easy 📞



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)