Check which one is larger using a python formula

Asked

Viewed 134 times

-4

I need to use this formula and read three values and present the largest of the three values read. Formula:

MaiorAB = (a+b+abs(a-b))/2

All three values are on the same receiving line. EX:

MaiorAB = input().split(' ')

Where and how I can use this formula?

  • 4

    And what is your question? Please edit the question and add more details of your attempt and what was the difficulty found.

  • Your question is very vague.. the impression is that you simply copied the statement of an exercise on Python ...

1 answer

3


How about:

a = int(input('a: '));
b = int(input('b: '));
c = int(input('c: '));

maior = max( a, b, c );

print(maior);

repl it.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.