Skip to content

Instantly share code, notes, and snippets.

@bernardobarreto
Created February 14, 2013 03:06
Show Gist options
  • Select an option

  • Save bernardobarreto/4950297 to your computer and use it in GitHub Desktop.

Select an option

Save bernardobarreto/4950297 to your computer and use it in GitHub Desktop.
basic list comprehension
from random import randint
def matilha():
return [Dog(("Dog%s" % i), randint(0,15)) for i in range(100)]
class Dog(object):
def __init__(self, name, age):
self.name = name
self.age = age
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment