in reply to Yet Another Rosetta Code Problem (Perl, Ruby, Python, Haskell, ...)
This is an imperative solution in Python:
- Antonio Ognio, Lima-Peru.