Drill 21: List the steps — Functions and collections
List the steps the code follows in order.
What you will be able to do
- List the steps the code follows in order.
Practice task
List the steps the code follows in order.
def average(values):
if not values:
return 0
return sum(values) / len(values)
scores = {"html": 88, "css": 92, "js": 79}
for skill, score in scores.items():
print(f"{skill.upper()}: {score}")
passed = [skill for skill, score in scores.items() if score >= 80]
print(f"Passed: {passed}")
print(f"Average: {average(list(scores.values())):.1f}")Your turn
EasyWrite your answer
List the steps the code follows in order.
TEXT · starter
Your answer…Study tools
Make it yours.
Keep a private note for this lesson, then turn the key ideas into flashcards you can revisit.
Sign in to save notes and flashcards.Both are private to your account and stay with your progress.
Sign inFinished reading?
Lock in what you just learned.
0%
Mark this lesson complete to save your place and move one step closer to the certificate.