Python ↔ Baobab translation

Translation converts a program between Python and Baobab without changing its structure: indentation, layout and logic stay identical; only keywords and built-in functions are swapped.

Python
1
2
for i in range(3): print(i)
Baobab
1
2
pour i dans intervalle(3): afficher(i)
0 1 2

In Baobab Studio, switch with the BAO ⇄ PY button; on the command line, bao translate main.bao --to python. It is a source-to-source transformation, reversible both ways.