Python Basics · Beginner · 30 XP · about 3 min
Write a function called max_of_two(a, b) that returns the larger of two numbers (without using Python's built-in max() function).
max_of_two(5, 3) # Returns 5 max_of_two(3, 5) # Returns 5 max_of_two(7, 7) # Returns 7 max_of_two(-2, -5) # Returns -2
max() functionReady?
Accept the challenge to start writing. A small timer counts the time this page is in view.
Output appears here.