【发布时间】:2018-10-22 18:31:52
【问题描述】:
代码在 python shell 中按预期工作,通过空闲启动。通过 sublime text 运行文件时,它只会在控制台打印“请输入您的价格:”,而不在提交我的输入后运行其余代码。在控制台上按回车只会创建一个新行。在 python shell 中运行代码时,其余代码在将 int 提交到小费计算器后执行。
def calculateit():
price = input("please enter your price: ")
tip = int(price) * 0.25
final = int(tip) + int(price)
print ("since the price of your meal is " + str(price) + " your tip is " + str(tip))
print ("the total cost of your meal is " + str(final))
calculateit()
【问题讨论】:
-
我上次检查时 Sublime 没有接受用户输入
-
发帖前请尝试搜索问题。 forum.sublimetext.com/t/…
标签: python sublimetext3