【问题标题】:How do i get my program to align like this one?我如何让我的程序像这样对齐?
【发布时间】:2018-03-23 07:44:13
【问题描述】:

我正在研究同样的程序,但我不知道如何让我的对齐(输入、成本、$)像这样

【问题讨论】:

  • 如果你也包含你的代码会更容易提供帮助。
  • .. 和 not 作为图像。以文本形式将代码添加到问题中。
  • 查看字段宽度修饰符以格式化规范。

标签: python python-3.x format alignment currency


【解决方案1】:

我想写脚本的人只是简单地添加了一系列“”字符,如下所示:

print("Not formatted:  £10")
print()
print("      Formatted:        £10")
print(" Also formatted:        £10")

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-01-29
    • 1970-01-01
    • 2023-01-12
    • 2021-07-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多