Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use the zip () method in python Dictionary

Shulou Source: shulou.com Published: 2022-06-01 03:10:22 09月22日 Update

This article mainly introduces how to use the zip () method in the python dictionary, which has a certain reference value. Interested friends can refer to it. I hope you will gain a lot after reading this article.

Zip ()

Define the zip () method to package the key values into a dictionary

Li1 = ["name", "age"] li2 = ["hacker", "18"] print (dict (zip (li1,li2)

The running results are as follows:

{'name':' hacker', 'age':' 18'}

Thank you for reading this article carefully. I hope the article "how to use zip () in python Dictionary" shared by the editor will be helpful to you. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Tags: Articles dictionaries methods values interests at the same time more friends knowledge results editing industry information information channels channels references learning help support run Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei Xiaomi Redmi Shulou Tech Info MariaDB