## Simple Gratuities Calculator (Python 3.4)

All new tutorial are submitted here.
They will be moved to the main Tutorials section once they have been approved by mods and admins.

### Simple Gratuities Calculator (Python 3.4)

By a beginner for other beginners.

Code: Select all
`print ("\t\t\tGratuities Calculator") #Titlebill = float(input("\nPlease enter the amount of your bill £")) #User inputbig_tip = bill + 20/100 * bill #Calculation to add 20%bt = '{:.2f}' .format(big_tip) #Result to 2 decimal placessmall_tip = bill + 15/100 * bill #Calculation to add 15%st= '{:.2f}' .format(small_tip) #Result to 2 decimal placestiny_tip = bill + 5/100 * bill #Calculation to add 5%tt= '{:.2f}' .format(tiny_tip) #Result to 2 decimal placesprint ("\n\tTotal including 20% tip = £", bt) #---------print ("\n\tTotal including 15% tip = £", st)   #Print resultsprint ("\n\tTotal including  5% tip = £", tt) #----------input("\n\n Press Enter to exit") #Wait for user to end program`
Coding to pass the time.

anybloodyid

Posts: 22
Joined: Wed Jul 23, 2014 7:12 am
Location: Cheshire, England

### Re: Simple Gratuities Calculator (Python 3.4)

This is sample code, which would be fine in the Completed Scripts section, but a tutorial typically has some explanatory component.
Due to the reasons discussed here we will be moving to python-forum.io on October 1, 2016.

This forum will be locked down and no one will be able to post/edit/create threads, etc. here from thereafter. Please create an account at the new site to continue discussion.

micseydel

Posts: 3000
Joined: Tue Feb 12, 2013 2:18 am
Location: Mountain View, CA