我的函数返回变量,但是在“返回”代码之后,在控制台上没有显示任何与Jupiter Notebook不同的东西。
dollar = 1.0
quarter = dollar / 4
dime = dollar / 10
nickel = dollar / 20
penny = dollar / 100
def quarter_returns(change):
counter_quarter = 0
while change >= quarter:
change = change - quarter
counter_quarter = counter_quarter + 1
return "Your quarter change is {}, {}".format(counter_quarter,round(change,2))
quarter_returns(0.56)
答案 0 :(得分:1)