easy +10 pts

Max of three numbers

Write a function that returns the largest of three given numbers.

Write a function `max_of_three(a, b, c)` that takes three numbers and returns the largest among them. You may not use the built-in `max()` function. The numbers can be integers or floats. If there are ties, return the value (it is the same value, so equality does not matter). Your function should be defined exactly as: ```python def max_of_three(a, b, c): ... ```

Constraints

Input values are real numbers (integers or floats). No restrictions on range. Time complexity: O(1). Space complexity: O(1).

Example

```python
>>> max_of_three(1, 2, 3)
3
>>> max_of_three(5, 5, 5)
5
>>> max_of_three(-1, -2, -3)
-1
>>> max_of_three(2.5, 2.6, 2.4)
2.6
```
10 points ~10 min

Recent Submissions

No submissions yet — hit Run Tests to try!

Hints

Compare a and b first to find the larger of the two, then compare that with c.
You can use nested if-else statements.
Use the `>` or `<` operators only.
Python 3
All tests passed!
Test Results
Press Ctrl+Enter or click Run Tests to execute your code.