On 25/09/17 04:34, edmundo pierre via Tutor wrote:
I am trying to sort float numbers input by an user from the bigger to smaller 
number. I do not know how to compare float numbers. Any ideas? Thank you!

The same way you sort anything else.
Using the comparison operations
==, <, >, <=, >=

There is a slight snag in that comparing float to absolute values is not straightforward but for sorting thats irrelevant.

Of course, normally you just use the sort() method to do it, or call the sorted() function.


Alan G

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to