Multiple Iteration in Python
Multiple Iteration in Python,in this Article i will show how to iterate 2 set of Python Array.
Sample Code
- First I setup 2 set of Array , ” array a & array b “
- Then i use the for loop
- then i use the zip() function to zip both array together
- Use “%s” to do the string formatting
- 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