The Create Performance Task (guided) · 创作型表现任务(引导)
The Create Performance Task
- The Create Performance Task is a small program you design and build yourself.
- For the real AP exam you submit it (your code, a video, and written answers) through the AP Digital Portfolio.
- Important: the real task is graded by AP, not by this site. This lesson only helps you practice and structure it.
创作型表现任务
- 创作型表现任务(Create Performance Task)是一个你自己设计和编写的小程序。
- 在真正的 AP 考试里,你要通过 AP 数字作品集(AP Digital Portfolio)提交它(你的代码、一段视频和书面回答)。
- 重要提示: 真正的任务由 AP 评分,不是由本网站评分。这节课只帮助你练习并搭好结构。
What your program must include
- A list (or other collection) that stores many values together.
- A procedure (a function) that takes at least one parameter, and that you call in your code.
- An algorithm with selection (
if) inside iteration (a loop). - Some input and some output so the program does something useful.
你的程序必须包含什么
- 一个列表(list,或其他集合),把许多值存放在一起。
- 一个过程(procedure,即函数),它带有至少一个参数,并且你在代码里调用了它。
- 一个算法,在迭代(循环)内部使用选择(
if)。 - 一些输入和一些输出,让程序做点有用的事。
Pick a small idea
- Keep it simple: you only need to show the skills above, not build a huge app.
- Good ideas: grade a list of scores, total a shopping list, sort students into teams, count words.
- Choose data you understand, so you can explain it later.
挑一个小点子
- 保持简单:你只需要展示上面这些技能,而不必做一个庞大的应用。
- 好点子:给一组分数评级、把购物清单求和、把学生分到不同小组、统计单词数。
- 选你看得懂的数据,这样你之后才能解释它。
A starter scaffold
- The program below has all the required parts. Read the comments to find each one.
- It uses a fixed list so it runs the same every time (no live typing needed here).
- Run it, then change the data and rules to make it your own.
一个起始脚手架
- 下面的程序包含了所有必需的部分。读注释,找出每一个部分。
- 它使用一个固定的列表,所以每次运行结果都一样(这里不需要现场输入)。
- 先运行它,然后修改数据和规则,把它变成你自己的。
# 1) A LIST that stores many values
scores = [72, 95, 58, 88, 40, 67]
# 2) A PROCEDURE with a PARAMETER, that returns a result
def grade_for(score):
# selection inside the procedure: choose a letter for one score
if score >= 90:
return "A"
elif score >= 70:
return "B"
elif score >= 50:
return "C"
else:
return "F"
# 3) An ALGORITHM: SELECTION (if) INSIDE ITERATION (for loop)
pass_count = 0
for s in scores: # iteration: visit every score
letter = grade_for(s) # call the procedure with a parameter
if letter != "F": # selection: is this a pass?
pass_count = pass_count + 1
print(f"score {s} -> grade {letter}") # output
# More output: a summary
print(f"{pass_count} out of {len(scores)} passed")
Make it your own
- Change the list to your own data (and try a different length).
- Change the procedure: new rule, new parameter name, or return something else.
- Change the algorithm: count something new, or keep only items that pass the
if. - Add input if you like, for example
input("Enter a name: ").
把它变成你自己的
- 把列表换成你自己的数据(也试试不同的长度)。
- 修改过程:新的规则、新的参数名,或者返回别的东西。
- 修改算法:统计点新的东西,或者只保留通过
if的那些项。 - 如果你愿意,可以加上输入,例如
input("Enter a name: ")。
Written-response prompts
- Answer these about your own program (this is the kind of writing the real task asks for):
- Purpose: What does your program do, and why is it useful?
- List: What does your list store, and how does using one list (instead of many separate variables) make the program simpler to manage?
书面回答题
- 围绕你自己的程序回答下面这些问题(真正的任务要求的就是这类写作):
- 目的: 你的程序做什么?为什么它有用?
- 列表: 你的列表存了什么?为什么用一个列表(而不是许多个单独的变量)会让程序更容易管理?
More written-response prompts
- Procedure & parameter: Name your procedure. What is its parameter, and what does the procedure do with it? What does it return?
- Algorithm: Describe the algorithm inside your loop in your own words. Point to where it uses selection (
if) and where it uses iteration (the loop), and say why both are needed.
更多书面回答题
- 过程与参数: 说出你的过程的名字。它的参数是什么?过程用这个参数做了什么?它返回什么?
- 算法: 用你自己的话描述循环内部的算法。指出它在哪里用了选择(
if),在哪里用了迭代(循环),并说明为什么两者都需要。
Rubric checklist
- Tick each item once your program has it:
评分清单
- 当你的程序具备某一项后,就在它前面打勾:
[ ] A list (or collection) is used in the program
[ ] A procedure is defined WITH at least one parameter
[ ] That procedure is CALLED somewhere in the program
[ ] The procedure does real work (not empty)
[ ] An algorithm uses selection (if) INSIDE iteration (a loop)
[ ] The program has input and/or output
[ ] I can explain every part in my own words
You can do this
- Start small, run it often, and fix one thing at a time.
- When every box above is ticked, you have the structure the Create Task needs.
- Remember: practice here first, then submit the real task through the AP Digital Portfolio.
你一定可以做到
- 从小处开始,经常运行,一次只修一个地方。
- 当上面每个方框都打了勾,你就有了创作型任务所需要的结构。
- 记住:先在这里练习,然后通过 AP 数字作品集 提交真正的任务。
Common mistakes
- Plan the program's purpose first, then build in small tested pieces.
- Be ready to explain what each part of your code does.
常见错误
- 先规划程序的目的,再小块构建、逐块测试。
- 要能解释代码每一部分的作用。
Now you try
- A warm-up: assemble the required parts once, using the scaffold's example data.
- Press Check answer to confirm every required part is there.
现在轮到你
- 热身:用脚手架里的示例数据,把需要的部分组装一次。
- 按检查答案来确认每个必需的部分都在。
A warm-up that uses the scaffold's example data. (1) Keep the list scores. (2) Define grade_for(score) (one parameter) returning "A"/"B"/"C"/"F" by the rules above (>= 90, >= 70, >= 50, else "F"). (3) With selection (if) inside a loop over scores, count how many pass · 通过 (grade is not "F") into pass_count. (4) print a summary line. · 用脚手架里的示例数据做一个热身。(1)保留列表 scores。(2)定义 grade_for(score)(一个参数),按上面的规则(>= 90、>= 70、>= 50,否则 "F")返回 "A"/"B"/"C"/"F"。(3)在遍历 scores 的循环里用选择(if),把通过(等级不是 "F")的数量数进 pass_count。(4)print 一行总结。
Click Run to see the output here. · 点击“运行”查看此处输出。
The Create task also needs an algorithm you built yourself. Write top_score(scores) that returns the highest value using a loop — start with the first score, then compare each one. Do not · 不 use the built-in max. Then print the result. · 创作型任务还需要一个你自己搭建的算法。写一个 top_score(scores),用循环返回最高的值 —— 先取第一个成绩,再逐个比较。不要用内置的 max。然后 print 出结果。
Click Run to see the output here. · 点击“运行”查看此处输出。