Multiple Iteration in Python

Multiple Iteration in Python

Multiple Iteration in Python,in this Article i will show  how to iterate  2 set of Python Array.

Sample Code

  1. First I setup 2 set of Array , ” array  a  & array b “
  2. Then i use the for loop
  3. then i use the zip() function to zip both array together
  4. Use “%s” to do the string formatting
  5. Finally print out the Array

 


a = ['a', 'b','c','d']

b =['1','2','3','4']

for i,j in zip(a,b):
    print("%s is %s" % (i,j))

 

Results

Check out date and time in Python here

Leave a Reply

Your email address will not be published. Required fields are marked *

19 − 12 =