Porting some Python / Kotlin features to Nim.
$ nimble install pykot
To install the latest development version, issue the following command:
$ nimble install "https://github.com/jabbalaci/nimpykot@#head"
With nimble uninstall pykot
you can remove the package.
See here: https://jabbalaci.github.io/nimpykot/ .
Similar projects: https://github.com/search?q=nimpylib&type=repositories
Take an integer and reverse it. The result must also be an integer. Example: 1977 → 7791.
import unicode
import pykot/converters
proc reverse_number(n: int): int =
n.toStr().reversed().toInt()
let n = 2018
echo n # 2018
echo reverse_number(n) # 8102
See the samples/ directory for more examples.