** Accept 3 numbers in 3 individual variables and sort in descending order:**

def find_highest():

a,b,c=(13,222,24) # This can be taken as run time input.

print "\nNumbers are:",a,b,c

```
``` if a>b:

if a>c:

if b>c:

print "\n%d %d %d" %(a,b,c)

else:

print "\n%d %d %d" %(a,c,b)

elif a<c:

print "\n%d %d %d" %(c,a,b)

else:

if a<c:

if b<c:

print "\n%d %d %d" %(c,b,a)

else:

print "\n%d %d %d" %(b,c,a)

elif a<c:

print "\n%d %d %d" %(b,a,c)

`if __name__ == "__main__":`

find_highest()

Advertisements

## Comments

I have simpler methods.

Hope you will like it

>>> a = [1,2,4,5]

>>> sorted(a)

[1, 2, 4, 5]

>>> sorted(a, reverse=True)

[5, 4, 2, 1]

>>> a.sort()

>>> a

[1, 2, 4, 5]

>>> a.sort(reverse=True)

>>> a

[5, 4, 2, 1]

>>>