Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
NEED HELP NEW TO PYTHON!!
#6
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,

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
Reply


Messages In This Thread
NEED HELP NEW TO PYTHON!! - by RZola - Aug-14-2021, 06:01 AM
RE: NEED HELP NEW TO PYTHON!! - by DPaul - Aug-14-2021, 07:02 AM
RE: NEED HELP NEW TO PYTHON!! - by perfringo - Aug-14-2021, 07:09 AM
RE: NEED HELP NEW TO PYTHON!! - by supuflounder - Aug-14-2021, 08:04 PM
RE: NEED HELP NEW TO PYTHON!! - by RZola - Aug-14-2021, 07:53 AM
RE: NEED HELP NEW TO PYTHON!! - by jefsummers - Aug-15-2021, 12:24 PM
RE: NEED HELP NEW TO PYTHON!! - by naughtyCat - Aug-24-2021, 08:20 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020