144. Python Program to Rename Functions and Constants in PEP 8 Style
MediumNaming
Overview
Every naming style is mixed up in this program: camelCase, PascalCase, ALL CAPS and single letters. Give each name the right PEP 8 style.
Problem Statement
The starter code reads a line of marks, then prints their total and how many of them are 40 or more. For example, for 35 80 52:
Total: 167
Passed: 2
Rewrite it with PEP 8 names:
- the pass mark is a constant, so write it in
UPPER_CASE, - function names in
snake_case, starting with a verb, - variables in
snake_casewith clear names: no single letters, and neverl, - one space around
=,+=and>=, one after each comma, and two blank lines before and after each function.
Use input() with no prompt text: the tests type the input for you, and a prompt would end up in your output.
The tests check only the output, and the starter code already prints the right thing. So they can't see your names: check every name against the list yourself.
Input
One line with whole numbers separated by spaces. Example:
35 80 52
Output
The output for that example:
Total: 167
Passed: 2
The tests try 4 different inputs.