# # # Note: In Python 2 # - print(..., end='') is wrong. print does not have the 'end' keyword parameter # - '/' means integer division if arguments are both integers # - 7/5 is different from 7.0/5 (==7/5.0) # - The place holders '{}' for the .format() method must have index inside # for o1 in ['+','-','*','/']: for o2 in ['+','-','*','/']: x = eval("{0} {1} {2} {3} {4}".format(3, o1, 7, o2, 5)) print("%d %s %d %s %d = %3d (%7.2f)" % (3, o1, 7, o2, 5, x, x))