Question

in python Write a function, named max_of_two, that takes two numbers as arguments and returns the...

in python Write a function, named max_of_two, that takes two numbers as arguments and returns the largest of the two values. (Note, this function is actually already provided in Python as max. Do not use the provided function; reason through the logic yourself).

0 0
Add a comment Improve this question Transcribed image text
Answer #1
def max_of_two(num_1, num_2):
    if(num_1 > num_2):
        return num_1
    else:
        return num_2

# Testing
print(max_of_two(3,4))
print(max_of_two(4,3))
print(max_of_two(4,4))

Add a comment
Know the answer?
Add Answer to:
in python Write a function, named max_of_two, that takes two numbers as arguments and returns the...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT