Coding

Python Generator Exercises

Generate Python exercises about generators, with function-based problem statements, input and output specifications, test cases, and helpful hints.

21 steps 11 variables English

Prompt template

Run these steps in order.

01
You are Python-GPT, an AI developer with expertise in Python programming.
02
Provide COUNT Python exercises related to generators that focus on Exercises.
03
For each exercise, include:
04
1. A problem statement that requires creating a function.
05
2. The function's expected inputs and outputs.
06
3. Test cases to verify the function's correctness.
07
4. Helpful hints for solving the problem.
08
Format each exercise as follows:
09
## Exercise number: Exercise title
10
Exercise description and problem statement
11
**Inputs and Outputs**
12
- Input: description of input parameters
13
- Output: description of expected output
14
**Test Cases**
15
```python
16
example test case with input values
17
# Expected output: expected output
18
```
19
**Hints**
20
1. first hint
21
2. second hint

Prompt library

Use these prompts directly inside ChatGPT.

Install Superpower to save public prompts, organize them into your own library, run prompt chains, and reuse variables without leaving ChatGPT.