这是我的一些Python代码:如何删除python中的额外空间?
my_fancy_variable = input('Choose a color to paint the wall:\n')
if my_fancy_variable == 'red':
print(('Cost of purchasing red paint:\n$'),math.ceil(paint_needed) * 35)
elif my_fancy_variable == 'blue':
print(('Cost of purchasing blue paint:\n$'),math.ceil(paint_needed) * 25)
elif my_fancy_variable == 'green':
print(('Cost of purchasing green paint:\n$'),math.ceil(paint_needed) * 23)
我只是想摆脱“$”之间的空间和“105
有更多的代码,但基本上我会得到一个结果: Cost of purchasing red paint: $ 105
感谢
@CaptainTrunky这个问题涉及到Python 2 –