Practice · Python

Practice Arithmetic Operators

Compute with + - * / // % ** and store results in variables.

Arithmetic Operatorswarming python…

Convert minutes to hours and minutes (variant 2) (v2)

Write a function convert_minutes(total_minutes) that takes a non‑negative integer number of minutes and returns a tuple (hours, minutes) where hours is the whole number of hours and minutes is the leftover minutes. Use integer division (//) for hours and the remainder operator (%) for minutes.

Examples

convert_minutes(130)  # returns (2, 10)
convert_minutes(45)   # returns (0, 45)
Press Run to see output, or Check to grade against the tests.

Want a whole course built around arithmetic operators?

Start my path — free

Adaptive practice, streaks, projects with real code review. Free tier gates AI help, never content.