如何在python 3中删除空白

问题描述 投票:1回答:1

我有以下代码

nsum = 1+3+4

print("your total Calorie count is",nsum,".")

当我使用python 3.6运行脚本时

它打印出your total Calorie count is 8 .

但我想在nsum之后打印这句没有空格的句子。像这样:

your total Calorie count is 8.

我该怎么办?

python space sentence
1个回答
1
投票
nsum = 1+3+4

print("your total Calorie count is %d." % nsum)

有关格式化的更多信息,请参阅this page

© www.soinside.com 2019 - 2024. All rights reserved.