我根本不理解
bill = float(input("How much did the meal cost? "))
people = input("How many people are available to pay? ")
if bill < 50:
bill2 = 1 * bill+10
else:
bill2 = 1 * bill+20
print("Between everyone the meal costs", bill2 / people)
ERROR:
print("Between everyone the meal costs", bill2 / people)
TypeError: unsupported operand type(s) for /: 'float' and 'str'
答案 0 :(得分:1)
试试这个:
print("Between everyone the meal costs", bill2 / int(people))
其他解决方案是投人投入:
people = int(input("How many people are available to pay? "))