1 2 3 4 5 6 7 8 9 10 11 12 13
#! python3 import sys what = 'x=10;x+=20;x-=5' history = [] for a in what.split(";"): exec(a) history.append(x) print(history)