livepython.net

143. Fix a Variable That Hides a Python Built-in Function

EasyNaming

Overview

max isn't a keyword, so Python lets you use it as a variable name. But then the max() function is gone.

Problem Statement

The starter code should print the best score and the full marks, but it stops with a TypeError. Rename the variable that hides the max() function to a clear snake_case name, and keep max() for finding the best score. It should print:

Best score: 95
Out of: 100

Input

No input is required for this question.

Output

Best score: 95
Out of: 100

Learn this firstChapter 16 · Python Naming Conventions: snake_case, UPPER_CASE and More
solution.py
scores = [72, 95, 88]
max = 100
print("Best score:", max(scores))
print("Out of:", max)

EXPECTED OUTPUT

1Best score: 95
2Out of: 100

YOUR OUTPUT

Press Run to see your output here. Lines are compared with the expected output.