Hướng dẫn when to use zip python - khi nào nên sử dụng zip python

Phương thức python zip () lấy ITEBLE hoặc các thùng chứa và trả về một đối tượng lặp duy nhất, có các giá trị được ánh xạ từ tất cả & nbsp; container. & Nbsp; takes iterable or containers and returns a single iterator object, having mapped values from all the containers. 

Nó được sử dụng TomAP Chỉ số tương tự của nhiều container để chúng có thể được sử dụng chỉ bằng cách sử dụng một thực thể duy nhất. & NBSP;map the similar index of multiple containers so that they can be used just using a single entity. 

Cú pháp: & nbsp; zip (*iterators) & nbsp; zip(*iterators) 

Các tham số: Python Iterables hoặc Container (Danh sách, Chuỗi, v.v.) & NBSP; Giá trị trả về: & nbsp; Trả về một đối tượng iterator duy nhất, có các giá trị được ánh xạ từ tất cả & nbsp; container.Python iterables or containers ( list, string etc ) 
Return Value : Returns a single iterator object, having mapped values from all the 
containers.

Ví dụ về Python Zip ()

Ví dụ 1: Python Zip Two Danh sách

Python3

name = [ "Manjeet",

0 Mukesh 24
1 Roni 50
2 Chari 18
0____9
0 Mukesh 24
1 Roni 50
2 Chari 18
2

0 Mukesh 24
1 Roni 50
2 Chari 18
6= [
0 Mukesh 24
1 Roni 50
2 Chari 18
9,
{'reliance': 2175, 'infosys': 1127, 'tcs': 2750}
1,
{'reliance': 2175, 'infosys': 1127, 'tcs': 2750}
3,
{'reliance': 2175, 'infosys': 1127, 'tcs': 2750}
5
0 Mukesh 24
1 Roni 50
2 Chari 18
5

{'reliance': 2175, 'infosys': 1127, 'tcs': 2750}
7=
{'reliance': 2175, 'infosys': 1127, 'tcs': 2750}
9
The zipped result is : [('Manjeet', 4, 40), ('Nikhil', 1, 50), 
('Shambhavi', 3, 60), ('Astha', 2, 70)]


The unzipped result: 
The name list is : ('Manjeet', 'Nikhil', 'Shambhavi', 'Astha')
The roll_no list is : (4, 1, 3, 2)
The marks list is : (40, 50, 60, 70)
0

The zipped result is : [('Manjeet', 4, 40), ('Nikhil', 1, 50), 
('Shambhavi', 3, 60), ('Astha', 2, 70)]


The unzipped result: 
The name list is : ('Manjeet', 'Nikhil', 'Shambhavi', 'Astha')
The roll_no list is : (4, 1, 3, 2)
The marks list is : (40, 50, 60, 70)
1
The zipped result is : [('Manjeet', 4, 40), ('Nikhil', 1, 50), 
('Shambhavi', 3, 60), ('Astha', 2, 70)]


The unzipped result: 
The name list is : ('Manjeet', 'Nikhil', 'Shambhavi', 'Astha')
The roll_no list is : (4, 1, 3, 2)
The marks list is : (40, 50, 60, 70)
2
The zipped result is : [('Manjeet', 4, 40), ('Nikhil', 1, 50), 
('Shambhavi', 3, 60), ('Astha', 2, 70)]


The unzipped result: 
The name list is : ('Manjeet', 'Nikhil', 'Shambhavi', 'Astha')
The roll_no list is : (4, 1, 3, 2)
The marks list is : (40, 50, 60, 70)
3
The zipped result is : [('Manjeet', 4, 40), ('Nikhil', 1, 50), 
('Shambhavi', 3, 60), ('Astha', 2, 70)]


The unzipped result: 
The name list is : ('Manjeet', 'Nikhil', 'Shambhavi', 'Astha')
The roll_no list is : (4, 1, 3, 2)
The marks list is : (40, 50, 60, 70)
4

Output:

{('Shambhavi', 3), ('Nikhil', 1), ('Astha', 2), ('Manjeet', 4)}

Ví dụ 2: Python Zip liệt kêenumerate

Python3

The zipped result is : [('Manjeet', 4, 40), ('Nikhil', 1, 50), 
('Shambhavi', 3, 60), ('Astha', 2, 70)]


The unzipped result: 
The name list is : ('Manjeet', 'Nikhil', 'Shambhavi', 'Astha')
The roll_no list is : (4, 1, 3, 2)
The marks list is : (40, 50, 60, 70)
5=
The zipped result is : [('Manjeet', 4, 40), ('Nikhil', 1, 50), 
('Shambhavi', 3, 60), ('Astha', 2, 70)]


The unzipped result: 
The name list is : ('Manjeet', 'Nikhil', 'Shambhavi', 'Astha')
The roll_no list is : (4, 1, 3, 2)
The marks list is : (40, 50, 60, 70)
7
The zipped result is : [('Manjeet', 4, 40), ('Nikhil', 1, 50), 
('Shambhavi', 3, 60), ('Astha', 2, 70)]


The unzipped result: 
The name list is : ('Manjeet', 'Nikhil', 'Shambhavi', 'Astha')
The roll_no list is : (4, 1, 3, 2)
The marks list is : (40, 50, 60, 70)
8,
Player :  Sachin     Score : 100
Player :  Sehwag     Score : 15
Player :  Gambhir     Score : 17
Player :  Dravid     Score : 28
Player :  Raina     Score : 43
0,
Player :  Sachin     Score : 100
Player :  Sehwag     Score : 15
Player :  Gambhir     Score : 17
Player :  Dravid     Score : 28
Player :  Raina     Score : 43
2
0 Mukesh 24
1 Roni 50
2 Chari 18
5

Player :  Sachin     Score : 100
Player :  Sehwag     Score : 15
Player :  Gambhir     Score : 17
Player :  Dravid     Score : 28
Player :  Raina     Score : 43
4=
The zipped result is : [('Manjeet', 4, 40), ('Nikhil', 1, 50), 
('Shambhavi', 3, 60), ('Astha', 2, 70)]


The unzipped result: 
The name list is : ('Manjeet', 'Nikhil', 'Shambhavi', 'Astha')
The roll_no list is : (4, 1, 3, 2)
The marks list is : (40, 50, 60, 70)
7
Player :  Sachin     Score : 100
Player :  Sehwag     Score : 15
Player :  Gambhir     Score : 17
Player :  Dravid     Score : 28
Player :  Raina     Score : 43
7,
Player :  Sachin     Score : 100
Player :  Sehwag     Score : 15
Player :  Gambhir     Score : 17
Player :  Dravid     Score : 28
Player :  Raina     Score : 43
9, name 1
0 Mukesh 24
1 Roni 50
2 Chari 18
5

name 3 name 4name 5 name 6

The zipped result is : [('Manjeet', 4, 40), ('Nikhil', 1, 50), 
('Shambhavi', 3, 60), ('Astha', 2, 70)]


The unzipped result: 
The name list is : ('Manjeet', 'Nikhil', 'Shambhavi', 'Astha')
The roll_no list is : (4, 1, 3, 2)
The marks list is : (40, 50, 60, 70)
2
{'reliance': 2175, 'infosys': 1127, 'tcs': 2750}
9name 9

=0

The zipped result is : [('Manjeet', 4, 40), ('Nikhil', 1, 50), 
('Shambhavi', 3, 60), ('Astha', 2, 70)]


The unzipped result: 
The name list is : ('Manjeet', 'Nikhil', 'Shambhavi', 'Astha')
The roll_no list is : (4, 1, 3, 2)
The marks list is : (40, 50, 60, 70)
1=2

Output:

0 Mukesh 24
1 Roni 50
2 Chari 18

Ví dụ 3: Từ điển Python Zip ()

Python3

=3=

The zipped result is : [('Manjeet', 4, 40), ('Nikhil', 1, 50), 
('Shambhavi', 3, 60), ('Astha', 2, 70)]


The unzipped result: 
The name list is : ('Manjeet', 'Nikhil', 'Shambhavi', 'Astha')
The roll_no list is : (4, 1, 3, 2)
The marks list is : (40, 50, 60, 70)
7=6, =8, [ 0
0 Mukesh 24
1 Roni 50
2 Chari 18
5

[ 2=

The zipped result is : [('Manjeet', 4, 40), ('Nikhil', 1, 50), 
('Shambhavi', 3, 60), ('Astha', 2, 70)]


The unzipped result: 
The name list is : ('Manjeet', 'Nikhil', 'Shambhavi', 'Astha')
The roll_no list is : (4, 1, 3, 2)
The marks list is : (40, 50, 60, 70)
7[ 5, [ 779__[ 9
0 Mukesh 24
1 Roni 50
2 Chari 18
5

"Manjeet"1= "Manjeet"3name 3 "Manjeet"5

"Manjeet"6[ 2name 5

{'reliance': 2175, 'infosys': 1127, 'tcs': 2750}
9, 0

The zipped result is : [('Manjeet', 4, 40), ('Nikhil', 1, 50), 
('Shambhavi', 3, 60), ('Astha', 2, 70)]


The unzipped result: 
The name list is : ('Manjeet', 'Nikhil', 'Shambhavi', 'Astha')
The roll_no list is : (4, 1, 3, 2)
The marks list is : (40, 50, 60, 70)
1, 2

Output:

{'reliance': 2175, 'infosys': 1127, 'tcs': 2750}

Làm thế nào để giải nén? & Nbsp; 

Giải nén có nghĩa là chuyển đổi các giá trị có khóa kéo trở lại bản thân cá nhân. Điều này được thực hiện với sự trợ giúp của toán tử**.*” operator.

Python3

name =

The zipped result is : [('Manjeet', 4, 40), ('Nikhil', 1, 50), 
('Shambhavi', 3, 60), ('Astha', 2, 70)]


The unzipped result: 
The name list is : ('Manjeet', 'Nikhil', 'Shambhavi', 'Astha')
The roll_no list is : (4, 1, 3, 2)
The marks list is : (40, 50, 60, 70)
7"Manjeet",
0 Mukesh 24
1 Roni 50
2 Chari 18
0____9
0 Mukesh 24
1 Roni 50
2 Chari 18
2

0 Mukesh 24
1 Roni 50
2 Chari 18
6=
The zipped result is : [('Manjeet', 4, 40), ('Nikhil', 1, 50), 
('Shambhavi', 3, 60), ('Astha', 2, 70)]


The unzipped result: 
The name list is : ('Manjeet', 'Nikhil', 'Shambhavi', 'Astha')
The roll_no list is : (4, 1, 3, 2)
The marks list is : (40, 50, 60, 70)
7
0 Mukesh 24
1 Roni 50
2 Chari 18
9,
{'reliance': 2175, 'infosys': 1127, 'tcs': 2750}
1,
{'reliance': 2175, 'infosys': 1127, 'tcs': 2750}
3,
{'reliance': 2175, 'infosys': 1127, 'tcs': 2750}
5
0 Mukesh 24
1 Roni 50
2 Chari 18
5

0 Mukesh 24
1 Roni 50
2 Chari 18
15=
The zipped result is : [('Manjeet', 4, 40), ('Nikhil', 1, 50), 
('Shambhavi', 3, 60), ('Astha', 2, 70)]


The unzipped result: 
The name list is : ('Manjeet', 'Nikhil', 'Shambhavi', 'Astha')
The roll_no list is : (4, 1, 3, 2)
The marks list is : (40, 50, 60, 70)
7
0 Mukesh 24
1 Roni 50
2 Chari 18
18,
Player :  Sachin     Score : 100
Player :  Sehwag     Score : 15
Player :  Gambhir     Score : 17
Player :  Dravid     Score : 28
Player :  Raina     Score : 43
9, __1222222124

{'reliance': 2175, 'infosys': 1127, 'tcs': 2750}
7=
{'reliance': 2175, 'infosys': 1127, 'tcs': 2750}
9
0 Mukesh 24
1 Roni 50
2 Chari 18
29

{'reliance': 2175, 'infosys': 1127, 'tcs': 2750}
7=
0 Mukesh 24
1 Roni 50
2 Chari 18
32
0 Mukesh 24
1 Roni 50
2 Chari 18
33

The zipped result is : [('Manjeet', 4, 40), ('Nikhil', 1, 50), 
('Shambhavi', 3, 60), ('Astha', 2, 70)]


The unzipped result: 
The name list is : ('Manjeet', 'Nikhil', 'Shambhavi', 'Astha')
The roll_no list is : (4, 1, 3, 2)
The marks list is : (40, 50, 60, 70)
1
The zipped result is : [('Manjeet', 4, 40), ('Nikhil', 1, 50), 
('Shambhavi', 3, 60), ('Astha', 2, 70)]


The unzipped result: 
The name list is : ('Manjeet', 'Nikhil', 'Shambhavi', 'Astha')
The roll_no list is : (4, 1, 3, 2)
The marks list is : (40, 50, 60, 70)
2
0 Mukesh 24
1 Roni 50
2 Chari 18
36
0 Mukesh 24
1 Roni 50
2 Chari 18
37=
0 Mukesh 24
1 Roni 50
2 Chari 18
39

The zipped result is : [('Manjeet', 4, 40), ('Nikhil', 1, 50), 
('Shambhavi', 3, 60), ('Astha', 2, 70)]


The unzipped result: 
The name list is : ('Manjeet', 'Nikhil', 'Shambhavi', 'Astha')
The roll_no list is : (4, 1, 3, 2)
The marks list is : (40, 50, 60, 70)
1
0 Mukesh 24
1 Roni 50
2 Chari 18
33

The zipped result is : [('Manjeet', 4, 40), ('Nikhil', 1, 50), 
('Shambhavi', 3, 60), ('Astha', 2, 70)]


The unzipped result: 
The name list is : ('Manjeet', 'Nikhil', 'Shambhavi', 'Astha')
The roll_no list is : (4, 1, 3, 2)
The marks list is : (40, 50, 60, 70)
1
The zipped result is : [('Manjeet', 4, 40), ('Nikhil', 1, 50), 
('Shambhavi', 3, 60), ('Astha', 2, 70)]


The unzipped result: 
The name list is : ('Manjeet', 'Nikhil', 'Shambhavi', 'Astha')
The roll_no list is : (4, 1, 3, 2)
The marks list is : (40, 50, 60, 70)
2
0 Mukesh 24
1 Roni 50
2 Chari 18
44
0 Mukesh 24
1 Roni 50
2 Chari 18
45

0 Mukesh 24
1 Roni 50
2 Chari 18
46=
{'reliance': 2175, 'infosys': 1127, 'tcs': 2750}
9
The zipped result is : [('Manjeet', 4, 40), ('Nikhil', 1, 50), 
('Shambhavi', 3, 60), ('Astha', 2, 70)]


The unzipped result: 
The name list is : ('Manjeet', 'Nikhil', 'Shambhavi', 'Astha')
The roll_no list is : (4, 1, 3, 2)
The marks list is : (40, 50, 60, 70)
2
0 Mukesh 24
1 Roni 50
2 Chari 18
50
0 Mukesh 24
1 Roni 50
2 Chari 18
51

The zipped result is : [('Manjeet', 4, 40), ('Nikhil', 1, 50), 
('Shambhavi', 3, 60), ('Astha', 2, 70)]


The unzipped result: 
The name list is : ('Manjeet', 'Nikhil', 'Shambhavi', 'Astha')
The roll_no list is : (4, 1, 3, 2)
The marks list is : (40, 50, 60, 70)
1
The zipped result is : [('Manjeet', 4, 40), ('Nikhil', 1, 50), 
('Shambhavi', 3, 60), ('Astha', 2, 70)]


The unzipped result: 
The name list is : ('Manjeet', 'Nikhil', 'Shambhavi', 'Astha')
The roll_no list is : (4, 1, 3, 2)
The marks list is : (40, 50, 60, 70)
2
0 Mukesh 24
1 Roni 50
2 Chari 18
54
0 Mukesh 24
1 Roni 50
2 Chari 18
37=
0 Mukesh 24
1 Roni 50
2 Chari 18
39

The zipped result is : [('Manjeet', 4, 40), ('Nikhil', 1, 50), 
('Shambhavi', 3, 60), ('Astha', 2, 70)]


The unzipped result: 
The name list is : ('Manjeet', 'Nikhil', 'Shambhavi', 'Astha')
The roll_no list is : (4, 1, 3, 2)
The marks list is : (40, 50, 60, 70)
1
The zipped result is : [('Manjeet', 4, 40), ('Nikhil', 1, 50), 
('Shambhavi', 3, 60), ('Astha', 2, 70)]


The unzipped result: 
The name list is : ('Manjeet', 'Nikhil', 'Shambhavi', 'Astha')
The roll_no list is : (4, 1, 3, 2)
The marks list is : (40, 50, 60, 70)
2
0 Mukesh 24
1 Roni 50
2 Chari 18
60
0 Mukesh 24
1 Roni 50
2 Chari 18
37=
0 Mukesh 24
1 Roni 50
2 Chari 18
39

The zipped result is : [('Manjeet', 4, 40), ('Nikhil', 1, 50), 
('Shambhavi', 3, 60), ('Astha', 2, 70)]


The unzipped result: 
The name list is : ('Manjeet', 'Nikhil', 'Shambhavi', 'Astha')
The roll_no list is : (4, 1, 3, 2)
The marks list is : (40, 50, 60, 70)
1
0 Mukesh 24
1 Roni 50
2 Chari 18
65

The zipped result is : [('Manjeet', 4, 40), ('Nikhil', 1, 50), 
('Shambhavi', 3, 60), ('Astha', 2, 70)]


The unzipped result: 
The name list is : ('Manjeet', 'Nikhil', 'Shambhavi', 'Astha')
The roll_no list is : (4, 1, 3, 2)
The marks list is : (40, 50, 60, 70)
1
The zipped result is : [('Manjeet', 4, 40), ('Nikhil', 1, 50), 
('Shambhavi', 3, 60), ('Astha', 2, 70)]


The unzipped result: 
The name list is : ('Manjeet', 'Nikhil', 'Shambhavi', 'Astha')
The roll_no list is : (4, 1, 3, 2)
The marks list is : (40, 50, 60, 70)
2
0 Mukesh 24
1 Roni 50
2 Chari 18
68
0 Mukesh 24
1 Roni 50
2 Chari 18
37=
0 Mukesh 24
1 Roni 50
2 Chari 18
39

The zipped result is : [('Manjeet', 4, 40), ('Nikhil', 1, 50), 
('Shambhavi', 3, 60), ('Astha', 2, 70)]


The unzipped result: 
The name list is : ('Manjeet', 'Nikhil', 'Shambhavi', 'Astha')
The roll_no list is : (4, 1, 3, 2)
The marks list is : (40, 50, 60, 70)
1
0 Mukesh 24
1 Roni 50
2 Chari 18
73

The zipped result is : [('Manjeet', 4, 40), ('Nikhil', 1, 50), 
('Shambhavi', 3, 60), ('Astha', 2, 70)]


The unzipped result: 
The name list is : ('Manjeet', 'Nikhil', 'Shambhavi', 'Astha')
The roll_no list is : (4, 1, 3, 2)
The marks list is : (40, 50, 60, 70)
1
The zipped result is : [('Manjeet', 4, 40), ('Nikhil', 1, 50), 
('Shambhavi', 3, 60), ('Astha', 2, 70)]


The unzipped result: 
The name list is : ('Manjeet', 'Nikhil', 'Shambhavi', 'Astha')
The roll_no list is : (4, 1, 3, 2)
The marks list is : (40, 50, 60, 70)
2
0 Mukesh 24
1 Roni 50
2 Chari 18
76
0 Mukesh 24
1 Roni 50
2 Chari 18
37=
0 Mukesh 24
1 Roni 50
2 Chari 18
39

The zipped result is : [('Manjeet', 4, 40), ('Nikhil', 1, 50), 
('Shambhavi', 3, 60), ('Astha', 2, 70)]


The unzipped result: 
The name list is : ('Manjeet', 'Nikhil', 'Shambhavi', 'Astha')
The roll_no list is : (4, 1, 3, 2)
The marks list is : (40, 50, 60, 70)
1
0 Mukesh 24
1 Roni 50
2 Chari 18
81

Output: 

The zipped result is : [('Manjeet', 4, 40), ('Nikhil', 1, 50), 
('Shambhavi', 3, 60), ('Astha', 2, 70)]


The unzipped result: 
The name list is : ('Manjeet', 'Nikhil', 'Shambhavi', 'Astha')
The roll_no list is : (4, 1, 3, 2)
The marks list is : (40, 50, 60, 70)

Ứng dụng thực tế

Có nhiều ứng dụng có thể được cho là được thực thi bằng ZIP, có thể là cơ sở dữ liệu sinh viên hoặc thẻ điểm hoặc bất kỳ tiện ích nào khác yêu cầu ánh xạ các nhóm. Một ví dụ nhỏ về thẻ điểm được thể hiện dưới đây. & NBSP;student database or scorecard or any other utility that requires mapping of groups. A small example of scorecard is demonstrated below. 

Python3

0 Mukesh 24
1 Roni 50
2 Chari 18
82=
The zipped result is : [('Manjeet', 4, 40), ('Nikhil', 1, 50), 
('Shambhavi', 3, 60), ('Astha', 2, 70)]


The unzipped result: 
The name list is : ('Manjeet', 'Nikhil', 'Shambhavi', 'Astha')
The roll_no list is : (4, 1, 3, 2)
The marks list is : (40, 50, 60, 70)
7
0 Mukesh 24
1 Roni 50
2 Chari 18
85,
0 Mukesh 24
1 Roni 50
2 Chari 18
87,
0 Mukesh 24
1 Roni 50
2 Chari 18
89, __1919

0 Mukesh 24
1 Roni 50
2 Chari 18
95=
The zipped result is : [('Manjeet', 4, 40), ('Nikhil', 1, 50), 
('Shambhavi', 3, 60), ('Astha', 2, 70)]


The unzipped result: 
The name list is : ('Manjeet', 'Nikhil', 'Shambhavi', 'Astha')
The roll_no list is : (4, 1, 3, 2)
The marks list is : (40, 50, 60, 70)
7
0 Mukesh 24
1 Roni 50
2 Chari 18
98,
{'reliance': 2175, 'infosys': 1127, 'tcs': 2750}
00, __202

name 3

{'reliance': 2175, 'infosys': 1127, 'tcs': 2750}
09name 5
{'reliance': 2175, 'infosys': 1127, 'tcs': 2750}
9
{'reliance': 2175, 'infosys': 1127, 'tcs': 2750}
12

=0

The zipped result is : [('Manjeet', 4, 40), ('Nikhil', 1, 50), 
('Shambhavi', 3, 60), ('Astha', 2, 70)]


The unzipped result: 
The name list is : ('Manjeet', 'Nikhil', 'Shambhavi', 'Astha')
The roll_no list is : (4, 1, 3, 2)
The marks list is : (40, 50, 60, 70)
1
The zipped result is : [('Manjeet', 4, 40), ('Nikhil', 1, 50), 
('Shambhavi', 3, 60), ('Astha', 2, 70)]


The unzipped result: 
The name list is : ('Manjeet', 'Nikhil', 'Shambhavi', 'Astha')
The roll_no list is : (4, 1, 3, 2)
The marks list is : (40, 50, 60, 70)
2
{'reliance': 2175, 'infosys': 1127, 'tcs': 2750}
16
{'reliance': 2175, 'infosys': 1127, 'tcs': 2750}
17
{'reliance': 2175, 'infosys': 1127, 'tcs': 2750}
18

Output: 

Player :  Sachin     Score : 100
Player :  Sehwag     Score : 15
Player :  Gambhir     Score : 17
Player :  Dravid     Score : 28
Player :  Raina     Score : 43

Zip có phải là Python nhanh hơn không?

Không, nó không nhanh hơn.Chỉ viết dường như nhanh hơn in.Giải pháp của bạn dường như là về bản đồ thay vì zip, không viết thay vì in.. Only write seems to be faster than print . Your solution seemed to be about map instead of zip , not write instead of print .

Tôi có thể sử dụng gì thay vì zip trong Python?

Đó là itertools.izip (): Tạo một trình lặp tập hợp các phần tử từ mỗi lần lặp.Giống như zip () ngoại trừ việc nó trả về một trình lặp thay vì một danh sách.itertools. izip() : Make an iterator that aggregates elements from each of the iterables. Like zip() except that it returns an iterator instead of a list.

Sự khác biệt giữa liệt kê và zip trong Python là gì?

Hàm liệt kê () trả về các chỉ mục của tất cả các mục trong Iterables (danh sách, từ điển, bộ, v.v.) trong khi hàm zip () được sử dụng để tổng hợp hoặc kết hợp nhiều lần lặp. whereas the zip() function is used to aggregate, or combine, multiple iterables.

Tôi có thể sử dụng ZIP cho nhiều hơn hai danh sách Python không?

Hàm python zip () giúp bạn dễ dàng khóa hơn hai danh sách.Điều này hoạt động chính xác như bạn mong đợi, có nghĩa là bạn chỉ cần truyền trong danh sách dưới dạng các đối số khác nhau.. This works exactly like you'd expect, meaning you just only need to pass in the lists as different arguments.