1. 使用 `\t` 转义序列:
```python
print("Hello\tWorld")
输出:
```
Hello World
2. 使用Unicode字符 `u0009`:
```python
print(u"Hello\u0009World")
输出:
```
Hello World
3. 使用 `format()` 方法:
```python
name = "John"
age = 30
print("{}\t{}".format(name, age))
输出:
```
John30
4. 使用第三方库 `tabulate`:
```python
from tabulate import tabulate
data = [["Name", "Age"], ["John", 30], ["Jane", 25]]
print(tabulate(data, tablefmt="grid"))
输出:
```
+--------+-----+
| Name | Age |
+========+=====+
| John | 30 |
+--------+-----+
| Jane | 25 |
+--------+-----+
请注意,在代码中混合使用空格和制表符可能会导致缩进错误,因此建议统一使用空格或制表符进行缩进。在大多数现代Python编辑器中,可以设置将Tab键转换为4个空格,以保持代码风格的一致性。