#python #tutorial #course
00:00:00 example 1
00:03:20 example 2
00:04:36 exercise
00:06:19 conclusion
keyword arguments = arguments prefixed with the names of parameters
order of the arguments doesn’t matter
helps with readability
---- EXAMPLE 1 ----
def hello(greeting, title, first, last):
print(f"{greeting} {title}{first} {last}")
hello("Hello", title="Mr.", last="John", first="James")
---- EXAMPLE 2 ----
for number in range(1, 11):
print(number, end=" ")
print("1", "2", "3", "4", "5", sep="-")
---- EXERCISE ----
def get_phone(country, area, first, last):
return f"{country}-{area}-{first}-{last}"
phone_num = get_phone(country=1, area=123, first=456, last=7890)
print(phone_num)
In questa pagina del sito puoi guardare il video online Python keyword arguments are awesome! 🗝️ della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Bro Code 30 novembre 2022, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 56,849 volte e gli è piaciuto 1.5 mille spettatori. Buona visione!