A little more: decimal_portion
Seymore4Head
Seymore4Head at Hotmail.invalid
Sat Oct 4 10:58:52 EDT 2014
More information about the Python-list mailing list
Sat Oct 4 10:58:52 EDT 2014
- Previous message (by thread): [RELEASED] Python 3.2.6rc1, Python 3.3.6rc1
- Next message (by thread): A little more: decimal_portion
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
A little more: decimal_portion Write a function that takes two number parameters and returns a float that is the decimal portion of the result of dividing the first parameter by the second. (For example, if the parameters are 5 and 2, the result of 5/2 is 2.5, so the return value would be 0.5) http://imgur.com/a0Csi43 def decimal_portion(a,b): return float((b/a)-((b//a))) print (decimal_portion(5,2)) I get 0.4 and the answer is supposed to be 0.5.
- Previous message (by thread): [RELEASED] Python 3.2.6rc1, Python 3.3.6rc1
- Next message (by thread): A little more: decimal_portion
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list