View Single Post
Join Date: Oct 2004
Posts: 3,856
Reputation: vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice 
Solved Threads: 866
Moderator
vegaseat's Avatar
vegaseat vegaseat is offline Offline
DaniWeb's Hypocrite

Re: Comparing Python and C, Part 10, Structures

 
0
  #2
Jan 21st, 2007
You can simplify the Python 'for loop':
  1. # ... show it the Pythonian way (good for large person lists) ...
  2. personList = [emma, jack, arnie]
  3. for pers in personList:
  4. print '%s says "%s"' % (pers.name, pers.slogan)
May 'the Google' be with you!
Reply With Quote