unpacking-argument-lists.py
· 394 B · Python
Surowy
assert list(range(3, 6)) == [3, 4, 5]
arguments_list = [3, 6]
assert list(range(*arguments_list)) == [3, 4, 5]
def function_that_receives_names_arguments(first_word, second_word):
return first_word + ", " + second_word + "!"
arguments_dictionary = {"first_word": "Hello", "second_word": "World"}
assert function_that_receives_names_arguments(**arguments_dictionary) == "Hello, World!"
| 1 | assert list(range(3, 6)) == [3, 4, 5] |
| 2 | |
| 3 | arguments_list = [3, 6] |
| 4 | assert list(range(*arguments_list)) == [3, 4, 5] |
| 5 | |
| 6 | |
| 7 | def function_that_receives_names_arguments(first_word, second_word): |
| 8 | return first_word + ", " + second_word + "!" |
| 9 | |
| 10 | |
| 11 | arguments_dictionary = {"first_word": "Hello", "second_word": "World"} |
| 12 | assert function_that_receives_names_arguments(**arguments_dictionary) == "Hello, World!" |
| 13 |