#5 · 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() functionFirst solves only, ranked by stars and then time.