mystring= 'Fred enters the swamp and picks up %s to eat later.'
food1= 'python'
food2 = 'swamp apples'
print(mystring % (food1, food2))
Traceback (most recent call last):
File "<pyshell#3>", line 1, in <module>
print(mystring % (food1, food2))
TypeError: not all arguments converted during string formatting
command 'print(mystring % (food1, food2))' I don't understand why it says TypeError? Isn't it supposed to print as 'Fred enters the swamp and picks up a python and a swamp apple to eat later' ??