Question

Python Write a function (named largest_of_three) that takes three parameters and returns the largest. You can...

Python

Write a function (named largest_of_three) that takes three parameters and returns the largest. You can assume the parameters are either floats or ints.

0 0
Add a comment Improve this question Transcribed image text
Answer #1
def largest_of_three(n1, n2, n3):
    large = n1
    if n2 > large:
        large = n2
    if n3 > large:
        large = n3
    return large


# Testing the function here. ignore/remove the code below if not required
print(largest_of_three(3, 9, 1))

Process finished with exit code

Add a comment
Know the answer?
Add Answer to:
Python Write a function (named largest_of_three) that takes three parameters and returns the largest. You can...
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