Python

From Elvanör's Technical Wiki
Revision as of 15:33, 31 July 2008 by Elvanor (talk | contribs)
Jump to navigation Jump to search

Useful techniques

  • To iterate over two lists at the same time, use the zip built-in function:
for a,b in zip(list1, list2):

Casts

  • To cast a float to an integer, you can use the built-in int() function.