13 "animals = ('Moose', 'Elk', 'Fox', 'Owl', 'Wolf', 'Muskox', 'Ptarmigan', 'Grizzly', 'Wolverine')"
23 "import datetime as dt",
34 "def make_animals(filename, lines=100):",
35 " date = dt.date(2011, 4, 22)",
36 " one_day = dt.timedelta(days=1)",
38 " f = open(filename, 'w')",
40 " for _ in xrange(lines):",
41 " animal = random.choice(animals)",
42 " hour = random.randint(0, 23)",
43 " minute = random.randint(0, 59)",
44 " number = random.randint(1, 42)",
46 " date_str = '{}-{:02d}-{:02d}'.format(date.year, date.month, date.day)",
48 " time_str = '{:02d}:{:02d}'.format(hour, minute)",
50 " line = '{} {} {} {}\\n'.format(date_str, time_str, animal, number)",
54 " if random.choice((True, False)):",
55 " date = date + one_day",
67 "make_animals('animals.txt', 5)"
77 "make_animals('big_animals.txt')"
87 "make_animals('merida_animals.txt')"
97 "make_animals('fergus_animals.txt')"
107 "make_animals('macguffin_animals.txt')"
109 "language": "python",
117 "make_animals('dingwall_animals.txt')"
119 "language": "python",
127 "language": "python",