Section 1 - Instruction

We've covered a lot about functions - creating them, using parameters, returning values, defaults, and scope. Now let's put it all together by building useful functions from scratch!

Engagement Message

Ready to become a function-building expert?

Section 2 - Instruction

Let's design a function step-by-step. We want to calculate the final grade for a student. What information do we need? A list of scores and maybe different weights for assignments.

Engagement Message

What would you name this function?

Section 3 - Instruction

Here's our plan: take scores and weights, calculate weighted average, then return a letter grade. Notice how we're breaking this complex task into smaller, manageable steps within one function.

Engagement Message

Can you see the logical flow?

Section 4 - Instruction

Before we implement our function, let's learn about a helpful Python tool. The sum() function is built into Python (just like print()) and adds up all numbers in a list:

Engagement Message

You see how pre-defined functions like sum() make our code much cleaner?

Section 5 - Instruction

Another useful tool is , which pairs up items from two lists. It's named after a zipper. This tool is perfect when you need to work with corresponding elements:

Sign up
Join the 1M+ learners on CodeSignal
Be a part of our community of 1M+ users who develop and demonstrate their skills on CodeSignal