for / while else doesn't make sense

Marko Rauhamaa marko at pacujo.net
Mon May 23 02:30:57 EDT 2016


Rustom Mody <rustompmody at gmail.com>:

> Haskell has (almost) what I learnt at school:
>
> Prelude> let (q,r) = 7 `divMod` 3
> Prelude> (q,r)
> (2,1)

Python:

   >>> divmod(7, 3)
   (2, 1)

> Replace the strange `divMod` with / and we are back to the behavior I
> first learnt at school

                                                               X
We never used '/' in school for anything. We used 'X : Y' or '---'.
                                                               Y

Anyway, every calculator in the world produces:

   1
   ÷
   2
   =

   ==> 0.5


Marko



More information about the Python-list mailing list