I changed all those print statements to a list. I changed the 1’s and 0’s for the T/F to 17 and 9.

#!/usr/bin/python3
import math
import operator


def get_truth(firstnum, op, secondnum):
rel_ops = {
'+': operator.add,
'-': operator.sub,
'*': operator.mul,
'/': operator.truediv,
'//': operator.floordiv,
'operator.add': operator.add,
'operator.sub': operator.sub,
'operator.mul': operator.mul,
'operator.truediv': operator.truediv,
'operator.floordiv': operator.floordiv,
'>': operator.gt,
'<': operator.lt,
'>=': operator.ge,
'<=': operator.le,
'==': operator.eq,
'!=': operator.ne,
'operator.gt': operator.gt,
'operator.lt': operator.lt,
'operator.ge': operator.ge,
'operator.le': operator.le,
'operator.eq': operator.eq,
'operator.ne': operator.ne
}
return rel_ops[op](firstnum, secondnum);

#!/usr/bin/env python3


from my_functions import *
list = []
list = [[17, '+', 9], [17, '-', 9], [17, '*', 9], [17, '/', 9], [17, '//', 9], [17, 'operator.add', 9],
[17, 'operator.sub', 9], [17, 'operator.mul', 9], [17, 'operator.truediv', 9], [17, 'operator.floordiv', 9],
[17, '>', 9], [17, '<', 9], [17, '>=', 9], [17, '<=', 9], [17, '==', 9], [17, '!=', 9], [17, 'operator.gt', 9],
[17, 'operator.lt', 9], [17, 'operator.ge', 9], [17, 'operator.le', 9], [17, 'operator.eq', 9],
[17, 'operator.ne', 9]
]

length = len(list)
print('Testing MDAS')
x = 0
while x < length:
if list[x][1] == 'operator.add' or list[x][1] == 'operator.add':
print('')
if list[x][1] == '>':
print('')
print('Testing truth or false')
print(list[x][0], list[x][1], list[x][2], '=', get_truth(list[x][0], list[x][1], list[x][2]))
x += 1