Fer programes

Welcome to Fer programes, a blog created with the intention to help us and other programmers in the developing of IT applications. It includes some commands used previously to solve specific problems, links to interesting web pages and general explanations about informatic topics. You are free to collaborate with comments when you consider it is oportune.

Monday, January 2, 2012

Python - How can I iterate through two lines?

You want the zip function.

a = [1,2,3]
b = ['a','b','c']
for
(n,l) in zip(a, b):
print "num: ", n ,"; let: ", l



num: 1 ; let: a
num: 2 ; let: b
num: 3 ; let: c
Posted by miquel at 9:47 AM No comments:
Labels: Python - Django
Newer Posts Older Posts Home
Subscribe to: Posts (Atom)

Search This Blog

Labels

  • Access (1)
  • CSS (1)
  • DataBases (3)
  • Fortran (5)
  • GIMP (2)
  • git (1)
  • Gnuplot (5)
  • GoogleEarth (1)
  • HTML - PHP (6)
  • JavaScript (1)
  • Joomla (2)
  • Lapack (2)
  • LATEX (3)
  • Linux - Programming (15)
  • MapReduce (2)
  • Matlab (2)
  • MySQL (9)
  • nvd3 (2)
  • Phone (1)
  • Python - Django (24)
  • R (7)
  • SAS (5)
  • Technology (1)

Blog Archive

  • ►  2013 (9)
    • ►  November (2)
    • ►  October (2)
    • ►  June (1)
    • ►  May (2)
    • ►  April (1)
    • ►  January (1)
  • ▼  2012 (17)
    • ►  December (1)
    • ►  November (1)
    • ►  October (3)
    • ►  September (2)
    • ►  August (1)
    • ►  June (2)
    • ►  April (1)
    • ►  February (5)
    • ▼  January (1)
      • Python - How can I iterate through two lines?
  • ►  2011 (23)
    • ►  December (4)
    • ►  November (2)
    • ►  October (2)
    • ►  September (8)
    • ►  July (1)
    • ►  June (2)
    • ►  April (1)
    • ►  March (2)
    • ►  January (1)
  • ►  2010 (48)
    • ►  November (6)
    • ►  October (7)
    • ►  September (1)
    • ►  August (9)
    • ►  July (4)
    • ►  June (21)

Què més fer? - What else can you do?

  • Fer muntanya
  • Fer problemes

Contact

ferprogrames@gmail.com
Simple theme. Theme images by luoman. Powered by Blogger.