我有一个名为message
.
message = "Hello, welcome!\nThis is some text that should be centered!"
我正在尝试使用以下语句将其置于默认终端窗口的中心,即 80 宽度:
print('{:^80}'.format(message))
哪个打印:
Hello, welcome!
This is some text that should be centered!
我期待类似的东西:
Hello, welcome!
This is some text that should be centered!
有什么建议么?