- Explore [has_child]
- All Courses [subitem]
- AI Career Platform [subitem]
- Hire form us [subitem]
- 1:1 Coaching/Mentoring [subitem]
- Job Board [subitem]
- Institute Partnerships [subitem]
- Resources [has_child]
- Master Classes [subitem]
- Discussion Forum [subitem]
- Coding Playground [subitem]
- Free Courses [subitem]
- Topics [has_child]
- Data Science [subitem]
- Software Development [subitem]
- Company Insights
- Interview Preparation [subitem]
- Python [subitem]
- Programming [subitem]
- Digital Marketing [subitem]
- Web Development [subitem]
- Success Stories [subitem]
Data Structures: Foundation of Effective Programming
Fundamentals of LCM and HCF-2
A Career in Digital Marketing - A Complete Guide for Beginners
Advanced Algorithms and Problem Solving Techniques
Basics of Javascript
Introduction to Big Data
What is the Scope of Digital Marketing in 2025
The Role and Importance of Banks in the Economy
What Is Content Marketing?
Introduction to Deep Learning: From Basics to Advanced Concepts
Python Libraries
The skills required to stay relevant in IT sector
Basic Guide to HTML & CSS – The Fundamentals of Web Development
10 Common Data Structures Every Programmer Must Know
6 Bootstrap Tools and Playground – One-stop shop for all Web Developmental Needs
Why is it Important for Freshers to Work in a Team?
Why Learn English?
Introduction To Cloud Computing
Introduction To SQL: A Complete Guide
How To Start Competitive Programming - A Complete Guide
Introduction to Goal Setting and Risk Profiling
Data Communication: A Process
All about C Programming Language
Header in C++
OOPs (Object Oriented Programming) in C++
Javascript vs Typescript: What is the Difference?
Step-by-Step Guide to Data Visualization with Power BI
Fundamentals of Divisibility Rules in Quantitative Aptitude
Getting Started with Tableau: Installation and Introduction
Understand Serialization and Deserialization in Java
Fundamentals of Digital Marketing
What is Grooming & Etiquette?
React Functional Components: Introduction
Why Group Discussion for Interview? The HR Perspective
Introduction to Natural Language Processing (NLP)
Java Programs: Know the Best Java Programs for Beginners
Fundas of Pandas
What is Digital Marketing & How to Become a Digital Marketer
What is Meant by Machine Learning & What Can Machine Learning Do?
Why Data Visualization is Important for Becoming a Data Scientist
What is Consulting? Essential Insights for Aspiring Consultants
Secrets Of A Good Resume, Which Will Get You Hired!
JSON vs XML: Differences
What is Email Marketing in Digital Marketing?
Most Common 10 Telephonic Interview Questions
Does a Linkedin profile really matter before getting a Job?
How to Apply for Jobs as Fresher & Get Selected in One Go
Introduction to Management Interview Preparation
The Multifaceted Relationships Between Banker and Customer
What is Search Engine Optimization & How It Works
Structure of DBMS
Why Social Media Marketing Is Important?
How To Start Your Career In Data Science
A quick guide to Asymptotic Analysis
What are Node.js and Basics of Node.js?
Operating System: Functions
A-Z about Python Variables
What are Collections in Python?
What is Full Stack Development?
Encapsulation in Java: A Comprehensive Tutorial
Software Testing: What it is?
What is a Job Interview?
Learn about Boolean in Python
The Ultimate Guide to Resume building for Freshers
Data Science vs. Data Analytics - What's the Difference?
Types of Data in Statistics
Job Trends In This Decade
Mastering Vocabulary: The Key to Verbal Ability
Ultimate Guide to HR Interview Questions for Freshers
C++ Language: An Overview
All About Resume and Its Importance
Introduction to Big Data Analytics: From Basics to Implementation
Software: Types & Definition
Discover the Versatility of Microsoft Excel: Your Swiss Army Knife for Data
Mastering SWOT Analysis for Business Success
Creating and Using Sets in Tableau: A Comprehensive Guide
Master Simple and Compound Interest Quickly and Accurately
Understanding the Loan Underwriting Process
System Testing: Explained
The Essential SUM Function in Excel: A Step-by-Step Guide
Understanding the Difference in Simple and Compound Interest over 2 and 3 Years
Mastering Data Filters in Tableau: A Step-by-Step Guide
Understanding Risk and Return in Mutual Funds
Mastering the MIN Function in Excel: Find the Lowest Value Instantly
Mastering Value Chain Analysis: Uncovering Business Opportunities
Understanding Credit Scoring Models: A Comprehensive Insight
Understanding Principle Multiplication with Compound and Simple Interest
Creating Calculated Fields in Tableau: A Step-by-Step Guide
Understanding PESTEL Analysis for Industry Evaluation
Combining Data Sources Using Data Blending in Tableau
Mastering the GE-McKinsey 9-Box Matrix: A Strategic Guide
Mastering the COUNT Function in Excel
Mastering Mutual Fund Investment and Redemption Plans
Understanding Simple Interest vs. Compound Interest
Understanding Credit Rating Agencies and Their Processes
Maximizing Organizational Performance with the Balanced Scorecard
Mastering the COUNTA Function in Excel
Bringing in More Data with Joins in Tableau
Mastering Mixtures and Alligations: Key Techniques and Practice
The Role of Financial Planning in Wealth Creation
zip() function is used to group multiple iterators. It is used to map similar indexes of multiple containers.
How Python's zip() Function Works
Let's start by looking up the documentation for zip() and parse it in the subsequent sections.
Syntax: zip(*iterators)
Parameters: Python iterables or containers ( list, string, etc )
Return Value: Returns a single iterator object, having mapped values from all the containers.
Make an iterator that aggregates elements from each of the iterables.
1. Returns an iterator of tuples, where the i-th tuple contains the i-th element from each of the argument sequences or iterables.
2. The iterator stops when the shortest input iterable is exhausted.
3. With a single iterable argument, it returns an iterator of 1-tuples.
4. With no arguments, it returns an empty iterator. – Python Docs
How the zip() Function Creates an Iterator of Tuples
The following illustration helps us understand how the zip() function works by creating an iterator of tuples from two input lists, L1 and L2. The result of calling zip() on the iterables is displayed on the right.
- Notice how the first tuple (at index 0) on the right contains 2 items, at index 0 in L1 and L2, respectively.
- The second tuple (at index 1) contains the items at index 1 in L1 and L2.
- In general, the tuple at index i contains items at index i in L1 and L2.
Example
## initializing two lists |
If you run the above program, you will get the following results.
('Harry', 'Emma', 'John') (19, 20, 18) |
General Usage Of zip()
We can use it to print the multiple corresponding elements from different iterators at once. Let's look at the following example.
Example 1
## initializing two lists |
If you run the above program, you will get the following result
Output
Harry's age is 19 |
Example 2 : Python zip enumerate
names = ['Mohan', 'Rohan', 'Yash'] |
Output
0 Mohan 34 |
Example 3 : Python zip() dictionary
stocks = ['realme', 'ibm', 'apple'] |
Output
{'realme': 2175, 'ibm': 1127, 'apple': 2750} |