NEWB: dividing numbers

Diez B. Roggisch deets at nospam.web.de
Sun Mar 8 19:16:07 EDT 2009


Lo schrieb:
> I just tried python first time.
> 
> 2/3
> 
> the result is zero
> 
> I want the result to be .333... 

Well, that's not going to happen - 2/3 is .666 if not done with integers...

> 
> How do I get this?

Use floating points.


 >>> 2.0 / 3.0
0.6666666666663


Diez



More information about the Python-list mailing list