Start learning free

LESSON 170 OF 410 · PROJECTS: EVERYDAY PROGRAMS

Report Card V1 - One Subject Average in Python

Practice

Compute a student's average score across three tests using integer division so the result is a whole number.

You start with:

test1 = 85
test2 = 92
test3 = 78

Build:

Average: 85

Rules:

  • Compute the integer average of test1, test2, and test3 using integer division (//).
  • Store the result in a variable named average. The checker prints "Average: " followed by its value for you, so do not print anything yourself.

Add the three tests inside parentheses, then use // 3 for integer division.

test1 = 85
test2 = 92
test3 = 78

average = (test1 + test2 + test3) // 3

STEP 1 OF 1
    Ctrl + Enter to check

    Report Card V1 in Python

    Keep going with PythonAbout 340 step-by-step lessons, from your first line of code to coding interviews. Free to start.
    Start learning free