Kodewick
Start learning →
Starter←→0 / 100

Battery percent

#080StarterNumbers3 min

A full phone battery holds full and right now left remains. Write battery_percent(left, full) to return the percentage left, rounded to a whole number with round.

Examples
battery_percent(1500, 3000)→50
battery_percent(1000, 3000)→33
main.py
def battery_percent(left, full):
    # your code here: left out of full, times 100, rounded
    pass
Ctrl + Enter runs too
Result

Run tries the examples. When they look right, Submit.