(amplitude, steps)
| 51 | import math |
| 52 | |
| 53 | def wave(amplitude, steps): |
| 54 | step_size = 2 * math.pi / steps |
| 55 | for step in range(steps): |
| 56 | radians = step * step_size |
| 57 | fraction = math.sin(radians) |
| 58 | output = amplitude * fraction |
| 59 | yield output |
| 60 | |
| 61 | |
| 62 | print("Example 2") |
no outgoing calls
no test coverage detected