Python Tip Calculator
I was reviewing some fundamental tutorials covering Python programming and used this code below to create a simple Tip Calculator. (https://www.codecademy.com/learn)
Nothing Fancy!! This was just for learning, but was kind of fun. You can easily elaborate on what is provided by adding some additional conditionals with elif and/or else.
**Code provided below for easy copy/paste.
########################################################
import sys
import datetime
meal = float(input('Please Enter the Meal Cost: '))
tax = float(input('Please Enter the Tax %: '))
tip = float(input('Please Enter the Tip Percentage %: '))
date = datetime.datetime.now()
if tax >= 0:
tax = tax * .01
if tip >= 0:
tip = tip * .01
meal = meal + meal * tax
total = meal + meal * tip
output = round(total,2)
print("\nTOTAL\n")
print(date.strftime("%I:%M:%S %m/%d/%Y"),'\n$',output,'\n')
Nothing Fancy!! This was just for learning, but was kind of fun. You can easily elaborate on what is provided by adding some additional conditionals with elif and/or else.
**Code provided below for easy copy/paste.
########################################################
import sys
import datetime
meal = float(input('Please Enter the Meal Cost: '))
tax = float(input('Please Enter the Tax %: '))
tip = float(input('Please Enter the Tip Percentage %: '))
date = datetime.datetime.now()
if tax >= 0:
tax = tax * .01
if tip >= 0:
tip = tip * .01
meal = meal + meal * tax
total = meal + meal * tip
output = round(total,2)
print("\nTOTAL\n")
print(date.strftime("%I:%M:%S %m/%d/%Y"),'\n$',output,'\n')
Thank you so much for sharing this great blog.Very inspiring and helpful too.Hope you continue to share more of your ideas.I will definitely love to read. buy dvd american horror story cult season 7
ReplyDeleteI really appreciate this wonderful post that you have provided for us. I assure this would be beneficial for most of the people. buy dvd rebecka martinsson season 1
ReplyDeleteYou provide the concept is very different and useful. Thank you for sharing with us and continuing the great blogging.
ReplyDeleteUnix Training in Chennai
Unix shell scripting Training in Chennai
Excel Training in Chennai
Corporate Training in Chennai
Oracle Training in Chennai
Oracle DBA Training in Chennai
Pega Training in Chennai
Unix Training in Chennai
Unix shell scripting Training in Chennai
It was really an interesting blog, Thank you for providing unknown facts.
ReplyDeleteaviation institute in Chennai
Air Hostess Training Institute in Chennai
Airline Courses in Chennai
ground staff training in Chennai
Aviation Academy in Chennai
air hostess training in Chennai
airport management courses in Chennai
ground staff training in Chennai
Really it was an awesome article...very interesting to read..You have provided an nice article....Thanks for sharing..
ReplyDeleteWeb Designing Course Training in Chennai | Web Designing Course Training in annanagar | Web Designing Course Training in omr | Web Designing Course Training in porur | Web Designing Course Training in tambaram | Web Designing Course Training in velachery
I am glad that I saw this post. It is informative blog for us and we need this type of blog thanks for share this blog, Keep posting such instructional blogs and I am looking forward for your future posts. Python Projects for Students Data analytics is the study of dissecting crude data so as to make decisions about that data. Data analytics advances and procedures are generally utilized in business ventures to empower associations to settle on progressively Python Training in Chennai educated business choices. In the present worldwide commercial center, it isn't sufficient to assemble data and do the math; you should realize how to apply that data to genuine situations such that will affect conduct. In the program you will initially gain proficiency with the specialized skills, including R and Python dialects most usually utilized in data analytics programming and usage; Python Training in Chennai at that point center around the commonsense application, in view of genuine business issues in a scope of industry segments, for example, wellbeing, promoting and account. Project Center in Chennai
ReplyDelete