@extends('template') @section('title') Lab 2: Extra bagels @stop @section('content') # Lab 2: Extra bagels These extra exercises build on the [bagels functions](bagels); if you haven't finished that part you should do that first. ## Create a made-to-order custom bagel
Define a function named `makeSeedyBagel` that takes three parameters: a
size, a color, and a seed color. It should add 5 seeds to the bagel in
random positions.
How can we pick something randomly? Python has a built-in `random` module
for that. You'll need to import it, just like you've been importing other
modules like `turtle`. One of the functions it provides is called
[`randint`](/reference/quickref#randint) which picks a random integer,
and which can be used to find locations for the seeds. [Our
quick-reference page](/reference/quickref#seed) has documentation on a
few other functions in the `random` module as well.
Hints:
1. Write one function to draw one randomly placed seed
2. The image above shows 5 seeds added to the bagel. You could add more
or less if you wanted.
3. Ideally, seeds should only appear on the body of the bagel, but
its okay if yours appear in the "hole"
4. Later in the semester, we will learn a better way of adding a
whole bunch of seeds (repeating a block of code)
You can test your function in the shell, or use the prepared line of code
in `test_bagels.py` to swap the 4th bagel for a seedy one.
@include('/labs/lab02/_toc')
@stop