My last version, still without division due to an unanswered question
def uniques_col(operators, max):
col = 0
if len(operators) > 1:
for op in operators:
col += uniques_col(op, max)
return col
if operators == '+':
for i in range(1,max):
col += max - i
# comment next lines if you don't want detail
for j in range(1,max-i+1):
print(i,operators,j,i+j)
elif operators == '-':
for i in range(1,max+1):
col += i
# comment next lines if you don't want detail
for j in range(1,i+1):
print(i,operators,j,i-j)
elif operators == 'x':
for i in range(1,max+1):
col += int(max/i)
# comment next lines if you don't want detail
for j in range(1,1+int(max/i)):
print(i,operators,j,i*j)
return col
while True:
op = input('operator\n')
max = int(input('max\n'))
print(uniques_col(op,max))