Sometimes it's easier to type out a full string with lots of variables as a single block and have the variables evaluated in-line, rather than switching in and out of a string. Here's how to do it in [[Python]]:
```python
with open(monsterFilePath + name + '.md', 'w') as output_file:
string = f'''---
name: {name}
size: {size}
type: {type}
environment: {environment}
hp: {hp}
ac: {ac}
initiative: {initiative}
alignment: {alignment}
legendary: {legendary}
lair: {lair}
unique: {unique}
cr: {cr}
tags: {tags}
source: "{source}"
---'''
```
The `f` when defining the string signifies that the `format()` function will be used to evaluate all variables (delineated within a pair of `{}`).