L
L
Lewiss2015-10-10 17:18:51
Python
Lewiss, 2015-10-10 17:18:51

"Programming in Python" fails to solve the problem?

"Write a Generous Visitor program that allows the user to enter the amount of
a restaurant bill. The program should output two values: a 15% tip and a 20% tip."
Sorry for the stupid question.
Please point out the mistake and, if possible, chew it.

#Программа считает сколько чаевых вы должны оставить.
many = int(input("Введите сумму вашего счета"))
ch1 = many / 100 * 15
ch2 = many / 100 * 20
print("Общая сумма = ". ch1)
print("Общая сумма = ". ch2)
input("\n\nНажмите Enter, чтобы выйти")

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Kirill Romanov, 2015-10-10
@Djaler

print("Общая сумма = ", ch1)
print("Общая сумма = ", ch2)

There should be commas, not periods

Z
zelsky, 2015-10-11
@zelsky

If I smoked 3.5 correctly

print ('Общая сума: {0!s}'.format(many / 100 * 15))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question