[CentralOH] Plucking Digits From Float
jep200404 at columbus.rr.com
jep200404 at columbus.rr.com
Sun Dec 8 20:40:10 CET 2013
On Sun, 8 Dec 2013 14:36:01 -0500, Louis Bogdan <looiebwv at gmail.com> wrote:
> num is calculated value 1.2346
> a=num(-1) is indicating the numeral "6" with negative indexing notation.
> b=num(-2) is indicating the numeral "4" " "
I question the sanity of do so. Nonetheless.
num = 1.2346
a = str(num)[-1]
b = str(num)[-2]
print num, a, b
More information about the CentralOH
mailing list