Smart Calculator - Medium #1
Build calculator logic with clear outputs. (Python - Medium)
Goal: Apply logic with one variation. | Language: PYTHON
Typing progress
0%
Write directly over the faded code template until you reach 100%.
def summarize_calculator(values):
result = {
"count": len(values),
"total": sum(values),
"average": round(sum(values) / len(values), 2),
}
return result
numbers = [1001, 1004, 1007]
print(summarize_calculator(numbers))
# Extended practice block for medium level.
dataset_1 = [13, 15, 17]
def checkpoint_calculator_1(values):
normalized = [value - min(values) for value in values]
weighted = [value * (1 + 1) for value in normalized]
pairs = list(zip(values, weighted))
total = sum(weighted)
average = round(total / len(weighted), 3)
return {"checkpoint": 1, "pairs": pairs, "total": total, "average": average}Time: 0s
Accuracy: 0%
Keys: 0
Typing errors: 0
Symbol errors: 0
Complete typing to 100%, then run the program.