Python keyword arguments are awesome
, 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 doesnt matter, helps with readability , EXAMPLE 1 def hello(greeting, title, first, last): print(f greeting titlefirst last ) hello( Hello, last John, first James ) , EXAMPLE 2 for number in range(1, 11): print(number, end ) print( 1, 2, 3, 4, 5, sep ) , EXERCISE def getphone(country, area, first, last): return f countryareafirstlast phonenum getphone(country1, area123, first456, last7890) print(phonenum)
|