Probably simple syntax error

ptn tn.pablo at gmail.com
Mon Jul 2 10:27:35 EDT 2007


>
> Problem 6: big_randomized_int can only have values in 0, 1, ..., 98,
> 99. So small_randomized_int will have the value 0, always.
>
> Perhaps you meant:
>     small_randomised_float = big_randomized_int / 100.0
>
> >         small_randomized_int = Round(small_randomized_int, 2)
> >         # Round that value to 2 decimal places
>

PASCAL   -->    PYTHON
5 div 2      -->       5/2
5 mod 2    -->       5 % 2
5/2            -->       5/2.    (Notice the little dot at the end)




More information about the Python-list mailing list