1. 使用`print()`函数和转义字符`
`:
```python
输出结果:
```
第一行
第二行
2. 使用空字符串:
```python
print("这是第一行\n\n这是第三行")
输出结果:
```
这是第一行
这是第三行
3. 使用原始字符串(在字符串前加`r`前缀):
```python
print(r"第一行\n\n第二行")
输出结果:
```
第一行
第二行
4. 在文件操作中保留空行:
```python
text = "第一行\n\n第二行"
with open("output.txt", "w") as file:
file.write(text)
以上方法都可以用来在Python中创建空行