Python Forum
Help with simple tip calculator
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with simple tip calculator
#1
Can someone please fix my code for a simple tip calculator? I am new to Python.
price_meal = raw_input("How much did your meal cost?")
tip = raw_input("How much do you want to tip, in decimal form?")

price_meal += price_meal * tip
print "Your total cost is %s." % (price_meal)

Also how can I round the price of the meal after adding the tip to two decimal places? Thanks.
Reply


Messages In This Thread
Help with simple tip calculator - by DragonG - Oct-23-2018, 12:21 AM
RE: Help with simple tip calculator - by ichabod801 - Oct-23-2018, 01:28 AM
RE: Help with simple tip calculator - by ichabod801 - Oct-23-2018, 01:32 AM
RE: Help with simple tip calculator - by DragonG - Oct-23-2018, 02:57 AM
RE: Help with simple tip calculator - by ichabod801 - Oct-23-2018, 03:19 AM
RE: Help with simple tip calculator - by snippsat - Oct-23-2018, 04:54 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Simple Calculator Help destr0yer667 1 3,533 May-22-2019, 02:11 PM
Last Post: ichabod801
  Python Program to Make a Simple Calculator jack_sparrow007 2 10,232 Oct-19-2018, 08:32 AM
Last Post: volcano63
  Need help with simple calculator. ghost0fkarma 3 2,775 Sep-11-2018, 07:40 PM
Last Post: woooee

Forum Jump:

User Panel Messages

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