How do i solve this below quction?


#1

**i got that quction from

Blockquote

https://www.codecademy.com/courses/learn-python/lessons/tip-calculator/exercises/reassign-in-a-single-line?action=resume_content_item&link_content_target=interstitial_undefined

**
On line 7, reassign meal to the value of itself + itself * tax. And yes, you’re allowed to reassign a variable in terms of itself!

We’re only calculating the cost of meal and tax here. We’ll get to the tip soon.strong text


#2

To calculate just the tax, we would multiply the meal times the tax rate.

tax_amount = meal* tax

To add the tax to the cost of the meal,

meal + tax_amount

which would then be reassigned to the meal variable,

meal = meal + tax_amount

but tax_amount is,

meal * tax

so,

meal = meal + meal * tax

Make sense?


#3

thank sir. i could be solve my question because you


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.