print "Hello World"
Hello World
def echoPrint(s):
if s:
print "{} = {}".format(s, eval(s))
commands = """
(5 - 6)
8 * 9
6 / 2
5 / 2
5.0 / 2
5 % 2
2 * (10 + 3)
2 ** 4
"""
for command in commands.split('\n'):
echoPrint(command)
(5 - 6) = -1 8 * 9 = 72 6 / 2 = 3 5 / 2 = 2 5.0 / 2 = 2.5 5 % 2 = 1 2 * (10 + 3) = 26 2 ** 4 = 16
File "<string>", line unknown ^ SyntaxError: unexpected EOF while parsing