#acl ChrisSeidel:read,write,delete,revert All:read

= Python Tips =

aka Things I can't seem to remember.

Find the last n elements of a list:

{{{
foo = random.sample(range(10, 30), 15)
foo[:-5:-1]
}}}

== Iterate over a Dictionary ==

{{{
foo = {'a':3, 'b':7, 'cat':13}
for key, value in foo.items():
  print(key, value)
}}}