Question: class H04: def init__(self): pass def exec(self, prog): return ERROR # may use: may not uset str() int() strip) try-catch split() dictionary def play(prog): h4
class H04: def init__(self): pass def exec(self, prog): return "ERROR" # may use: may not uset str() int() strip) try-catch split() dictionary def play(prog): h4 - H04) out - 14.exec(prog) print(f ' {prog} ---- --In(out)-------in) . play('print 45') play('; ; ; print 3; ; ; print 5;) play('print 1 + 2 + 3') play('alpha = 1; beta - 2; ganna - alpha + beta;') play('alpha = 1; beta - 2; print alpha; gamma = alpha + beta;) play('x -1; print x') play('x = 15; print x + 30') play('x - 15; x = 40; print x + 100) play('x = 10; y = x + 40; print x + y) play('hello - 123; world - 7000; print hello + world') play('apple = 3; orange = 4; print apple; cherry = apple + orange + apple; print cherry) play'a + 1; print a; b = 2; print b; In print a + b;') play('x = 4; * =* + 3; y = x + x + x; print y; print x;') play('* = 4; if * > 7 then x = 500; print x') play('x = 4; if x > 2 then x = 50e; print x') the following should returns ERROR play('print x) play('x = 4; X = 2 + y ) play('17 4 then print 5) play('* = 35; print x')
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
