Functions · Prompt Construction
Specify a vowel counter without writing it
Do not write the Python. Write a short specification (the kind of prompt you would give a colleague or a model) that would produce a function meeting the requirements below. Include behaviour for edge cases. Tricks such as 'act as a senior engineer' are not the point.
Need a function that counts vowels in a string. Vowels are a, e, i, o, u. The function will be used on user names, so letter case should not matter. The empty string should be allowed. The caller needs the count as a number, not a printed message. The letter y should not be treated as a vowel in this first version.
Why this activity was chosen
- Bloom level: L3 Application: State requirements clearly enough to specify a solution.
- Block Model level: Macro Structure (step 4 of 4): the purpose of the whole program: the problem it solves and the goal it serves.
- Misconception targeted: shown after you answer, so it does not give the answer away.
The learning goal is precise communication of behaviour — inputs, outputs, and edge cases — not prompt-engineering tricks. If a requirement is underspecified, generated code will guess.
AI’s role here: AI may later critique missing constraints in the student's specification. It must not generate the program itself.