• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: How do I make textwrap print a variable along with some text?

Resolved: How do I make textwrap print a variable along with some text?

0
By Isaac Tonny on 16/06/2022 Issue
Share
Facebook Twitter LinkedIn

Question:

This is the code I’m using to make part of a text-based game:
I want to use textwrap to print the text without the words getting split at the end of a line, which works fine, but when I put a variable (armour) in the text it comes up with an error message:
Does anyone know how to fix this? I don’t want to use \n instead of textwrap due to different monitor sizes.

Answer:

In order to use variables in a string you have to use a format or f string.
more…

If you have better answer, please add a comment about this, thank you!

python text-based tuples wrapper
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: When converting markdown to latex with pandoc, how can I end a block before the next heading?

26/03/2023

Resolved: TYPO3 SQL error: Field ‘tx_imagezoom_set’ doesn’t have a default value

26/03/2023

Resolved: std::regex_replace to replace multiple combinations

26/03/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.