R
R
Rulon Oboevv2016-03-11 21:05:50
Python
Rulon Oboevv, 2016-03-11 21:05:50

Where to write numbers so that Python would count them?

car = input ("Техническое обслуживанаие машины 'Ламборгини':  ") 
rent = (input("Съем раскошной квартиры В Манхэттене:  ")) 
jet = (input("Аренда самолета:  ")) 
gifts = (input("Подарки:  ")) 
food = (input("Обеды и ужины в ресторанах:  ")) 
staff = (input("Жалованье прислуги:  ")) 
guru = (input("Плата личному психоаналитику: ")) 
games = (input("Компьютерные игры:  ")) 
total = car + rent + jet + gifts + food + staff + guru + games 
print("\nОбщая сумма:", total)

An assignment from a Python textbook, I don’t know where to insert the numbers, so that at the end I can calculate everything

Answer the question

In order to leave comments, you need to log in

4 answer(s)
M
MK, 2016-03-11
@Maxsior

"It makes me cry"...
Go read the textbook normally.

D
Dimonchik, 2016-03-11
@dimonchik2013

Dawson is a test troll

S
sim3x, 2016-03-11
@sim3x

Compare two lines and think where is the mistake

car = input ("Техническое обслуживанаие машины 'Ламборгини':  ") 
rent = (input("Съем раскошной квартиры В Манхэттене:  "))

S
Sergey Pankov, 2016-03-22
@trapwalker

Look closely at these two lines:
car = input ("Lamborghini Maintenance: ")
rent = (input("Luxury Apartment Rent In Manhattan: "))
The first stores the value entered by the user under the name car, and the second stores there a tuple with one element - the value entered by the user.
When adding tuples, they are concatenated, which was clearly not required in the assignment.
Remove extra brackets.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question