This chapter is mainly about using for and zip to use multiple sequences in parallel
1.zip function: Knead multiple sequences together
Note: Zip is a one-to-one relationship, and if an object is empty, it will not appear.
We look at the results from above, which is the original list
They are combined by a zip function and then iterated in parallel.
2. Building a dictionary using zip
The above code we use two methods to build a dictionary, one is to use a for loop to build, one is directly using the built-in function dict to build
Summary: This chapter focuses on using for and zip to use multiple sequences in parallel, and how to build a dictionary using zip
This chapter is here, thank you.
------------------------------------------------------------------
Click to jump 0 basic python-Catalogue
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
0 Fundamentals python-12.6 using for and zip to use multiple sequences in parallel