2.tip calculator 2


#1



ok so im currently on the first meal task in python and i cant for the life of me figure out my problem, maybe im blind or something but i cant figure it out


i cant see why this doesnt work but it doesnt so can anyone who speaks snake tell me why python doesnt accept it

Replace this line with your code.


#2

HI the lesson only aske you to..
Create a variable meal save in it 44.50
so you just need to do

meal = 44.50

#3

but as u can see in my screenshot i HAVE a variable called meal = 44.50
the problem that pyth hates is apparently on line 4


#4

Actually you are doing things way ahead of whatever is required by the instructions, but I guess you just want to challenge yourself first before reading the next few exercises :stuck_out_tongue:

Anyway, your code didn't work because of how you wrote it. For example, you wrote:

 meal / 100 * 6.75 = tax

Unfortunately, Python is a formal language, so it is really strict on the syntax and stuff. In Python, when you assign a value to a variable such as tax, the assignment binds a name on the left hand side of the operator to the value on the right hand side of the operator.

So, the correct phrasing should be:

tax = meal / 100 * 6.75

Switch all the others around as well, and the code should run fine.


#5

hey i've some problem too..

meal = 44.50
tax = meal / 100 * 6.75
tip = meal / 100 * 15
total = tax + tip + meal

total_print =

help me please with the explain about this part...thanks


#6

What you want to assign to total_print variable?
You have everything to end this lesson, just print a value of total variable.


#7

oh just print from total_print with the same meal number