Loop over two or more sequences at the same time : Zip : Buildin Function PYTHON examples


PYTHON examples » Buildin Function » Zip »

 

Loop over two or more sequences at the same time


Loop over two or more sequences at the same time

# Loop over two or more sequences at the same time, 
# the entries can be paired with the zip() function.

questions = ['A''B''C']
answers = ['a''b''c']

for q, a in zip(questions, answers):
     print 'What is your %s?  It is %s.' % (q, a)


           
       



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON examples

 Navioo Buildin Function
» Zip