【发布时间】:2022-06-14 23:37:24
【问题描述】:
my_money = input('How much money do you have? ')
boat_cost = 20 + 5
if my_money < boat_cost:
print('You can afford the boat hire')
else :
print('You cannot afford the board hire')
【问题讨论】:
-
提示 -
int(输入.....)。input()会给你的字符串 (str) 所以你必须把它转换成整数。 -
你的
logic比较也是错误的。 -
也许船长只把船租给买不起的人,即对穷人的无私姿态
标签: python function python-requests pycharm python-3.7