16 lines
437 B
Python
16 lines
437 B
Python
def calculate(a, b):
|
|
"""Return a dict with the four basic operations on (a, b).
|
|
|
|
Convert both inputs with float() so output is consistent.
|
|
|
|
Returned dict has these exact keys:
|
|
"sum" — a + b
|
|
"difference" — a - b
|
|
"product" — a * b
|
|
"quotient" — a / b
|
|
|
|
calculate(10, 5) -> {"sum": 15.0, "difference": 5.0,
|
|
"product": 50.0, "quotient": 2.0}
|
|
"""
|
|
pass
|