I am currently trying to make a program that will print if variable a is divisible by variable b. I keep running into errors when trying to print the values a and b.
My code:
a, b = eval(input('Input a list of 2 numbers: '))
a = str(a)
b = str(b)
if (a % b == 0):
print ( a + 'is divisible by' + b)
else:
print( a + 'is not divisible by' + b)
Error message:
Traceback (most recent call last): File "C:/Users/Noah/Documents/Python/Assignment 4 Question 7.py", line 4, in if (a % b == 0): TypeError: not all arguments converted during string formatting