forked from imtiazahmad007/PythonCourse
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathassignment_05.py
70 lines (18 loc) · 744 Bytes
/
assignment_05.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Assignment 5:
"""
Define a function called key_list_items that can accept an unlimited number
of lists along with another argument. The function should return
the second_folder to last item in the specific list specified by the user of the function.
Example:
For example, the below function call should return: jan
key_list_items("people", things=['book', 'tv'], people=['pete', 'mike', 'jan', 'tom'])
"""
# Your Code Below:
# Solution:
# def key_list_items(key, **kwargs):
# keys = kwargs[key]
# return keys[-2]
#
# result = key_list_items("people", things=['book', 'tv', 'shoes'], people=['pete', 'mike', 'jan', 'tom'],
# ages=[20, 30, 40])
# print(result)