Aug-15-2021, 12:24 PM
First, your question about sources for learning Python - there are lots of them. What programming experience do you have already? Know what languages? Do you have a particular learning style?
Second, you will get lots of options in your problem. I agree that you are looking at programming rather than problem, and take it a step farther. To calculate tip, you multiply by 1.15 rather than by 0.15 and adding to the base. Similar for tax. So,
Second, you will get lots of options in your problem. I agree that you are looking at programming rather than problem, and take it a step farther. To calculate tip, you multiply by 1.15 rather than by 0.15 and adding to the base. Similar for tax. So,
meal = 8 tip = 1.15 tax = 1.13 bill_1 = meal*tip + meal*tax - meal #don't double count meal bill_2 = meal*tax*tip print(f'The two calculated bills are {bill_1} and {bill_2}')
Output:The two calculated bills are 10.239999999999998 and 10.395999999999999