Python: TypeError: cannot concatenate ‘str’ and ‘int’ objects
There are two ways to fix the problem which is caused by the last print statement. You can assign the result of the str(c) call to c as correctly shown by @jamylak and then concatenate all of the strings, or you can replace the last print simply with this: in which case isn’t necessary and can be deleted. Output of sample run: with: