# Arithmetic Formatter Project - Printing multiple columns

Tell us what’s happening:
So I’m not sure how to go about getting the numbers to print out in multiple columns (of arithmetic problems).

# Arithmetic Formatter

print(""“Welcome. This is an arithmetic formatter. You will first enter how
many problems you wish to solve. You will then enter the first
number, followed by a + or -, and then the second number. No more than four
digits per number. You can enter up to five problems. When done, enter
‘calculate’ and your problems shall be solved and reformatted.”"")

while True:
try:
num_arith = int(input("How many arithmetic problems will you enter: "))
if num_arith < 6:
break
except:
print(“Error: Too many problems.”)

for i in range(num_arith):
while True:
try:
num_1 = int(input("Enter the first number: "))
if num_1 > -10000 and num_1 < 10000:
break
except:
print(“Error: Numbers cannot be more than four digits.”)

``````while True:
try:
operation = input("Enter + or - : ")
if operation == '+' or '-':
break
except:
print("Error: Operator must be '+' or '-'.")

while True:
try:
num_2 = int(input("Enter the second number: "))
if num_2 > -10000 and num_2 < 10000:
break
except:
print("Error: Numbers cannot be more than four digits.")

if operation == '+':
num_3 = num_1 + num_2
elif operation == '-':
num_3 = num_1 - num_2
elif operation != '+' or operation != '-':
print("Error: Entry was not + or -")
``````

print(f"\n{repr(num_1).rjust(5)} \n{operation} {repr(num_2).rjust(3)} \n----- \n{repr(num_3).rjust(5)}") # could also do (num_1, num_2, ‘-----’, num_3, sep=’\n’)

User Agent is: `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.67 Safari/537.36`.