-
Notifications
You must be signed in to change notification settings - Fork 55
/
Copy pathadvanced_test.py
53 lines (40 loc) · 1.19 KB
/
advanced_test.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
def create_squares_of_evens():
"""
Task:
- Create a list of squares for all even numbers from 1 to 20 using list comprehension.
Return:
- The list of squares of even numbers.
"""
pass
def convert_to_dict(students):
"""
Task:
- Convert the list of student tuples into a dictionary where the name is the key and the grade is the value.
Return:
- The dictionary created from the list of students.
"""
pass
def access_value_x(nested):
"""
Task:
- Access the value of 'x' from the nested dictionary `nested = {'a': [1, 2, 3], 'b': (4, 5), 'c': {'x': 10, 'y': 20}}`.
Return:
- The value of 'x' (which is 10).
"""
pass
def append_to_list_in_dict(nested):
"""
Task:
- Append the value 6 to the list under key 'a' in the nested dictionary `nested = {'a': [1, 2, 3], 'b': (4, 5), 'c': {'x': 10, 'y': 20}}`.
Return:
- The updated dictionary.
"""
pass
def convert_tuple_to_list_and_append(nested):
"""
Task:
- Convert the tuple under key 'b' in the nested dictionary into a list and add the value 6 at the end.
Return:
- The updated dictionary.
"""
pass