0
如何改變,
的默認值在下面的代碼,以便它不插入空格如何更改Python中逗號的值?
gas = int(input("How much have you spent on gas? "))
electric = int(input("How much have you spent on electric? "))
onlinePurchases = int(input("How much have you spent on online purchases? "))
total = gas + electric + onlinePurchases
print("Monthly Total: $", total)
當前的代碼將打印:
"Monthly total: $ *total*"
有沒有一種方法,使它打印:
"Monthly total: $*total*"
我不希望美元符號和金額之間的空間。
謝謝你,只是讓我知道是「月」短期的「分離」,如果沒有這是什麼立場? – user3131132
這是正確的 – mhlester