Если счет составлял 150,00 долл. США, разделенные между 5 человек, с 12% чаевым. /> < /ul>
Код: Выделить всё
bill = input("What is the total bill?")
# bill is 150.00
tip = input("What percentage tip would you like to give? 10, 12, or 15?")
# tip will be 12%
max_tip = float(tip) / 100
# split between 5 people
people = input("How many people to split the bill?")
max_split = int(bill) / int(people)
max_cost = int(max_split) * float(max_tip)
print(f"Each person should pay:{max_cost}")
< /code>
Это мой текущий вывод: < /p>
What is the total bill?150
What percentage tip would you like to give? 10, 12, or 15?12
How many people to split the bill?5
Each person should pay:3.5999999999999996
Код: Выделить всё
float(max_tip, 2)
Код: Выделить всё
line 77, in
max_cost = int(max_split) * float(max_tip, 2)
TypeError: float expected at most 1 argument, got 2
Process finished with exit code 1
Подробнее здесь: https://stackoverflow.com/questions/768 ... calculator