"TypeError: must be str, not tuple" for the following code:
receipt.write(output_to_receipt)
Please may someone explain what this error is?
Change receipt.write(output_to_receipt)
to receipt.write(str(output_to_receipt))
.
This will change output_to_receipt
which is a tuple to a string and you'll be able to write.
output_to_receipt is a tuple, so you need to convert it to a string with str(output_to_receipt)
or "".join(output_to_receipt)
for example.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With