2012年1月23日月曜日

Python Help

python help

Python help needed - Python

I've been trying to make a cash register program and right now this is my draft. For the program, the prices need to add up to a total which than will be calculated with HST and discount amounts. The discount needs to be the lowest number price entered from all the prices, however lowest number won't work and instead will be saved as the highest number.

-num is total price
-price is self explanatory
-lowest is used to store the lowest number
-HST is the tax
-items is the total amount of items


Programming Python
Learn more
Mark Lutz

num=0
price=0
lowest=0
HST=0.13
items=0

print "Enter 0 to print receipt.\n-----------------------"

while price>0:

price=raw_input("Enter your price here: $")
price=float(price)
num=num+price#num is the subtotal
print "tag2"

while price<0:
print "Invalid number"
price=raw_input("Enter your price here $")
price=float(price)
num=price+num
print "tag 3"


Python Programming: An Introduction to Computer Science 2nd Edition
Learn more
John Zelle

if (price>0):
if (lowest<=price):
lowest=price
print "tag6"

items=items+1 #total amount of items

print "Subtotal: " ,num
print "Discount: " ,lowest
print "After discount: " ,num-lowest
print "HST: " ,(num-lowest)*HST
print "Total: " ,(num-lowest)+((num-lowest)*HST)
print "-----------------------"
print "tag4"



These are our most popular posts: python help

flashcards 2.1 : Python Package Index

Python @ DaniWeb - hi i got a a Tkinter text widget and a string i want to know how to display the string in the text widget ?? abc = hello world text = Text(app, width=80,height=40, wrap=).grid(row=2, column=2) read more

electlindell.org » Blog Archive » Help guide Tending to an Exotic ...

This is a simple project that I need done immediately. Please dont apply unless you are available to complete this project within minutes. As soon as you. read more

Need Help Opening a Python File in Python Shell by aguttormsen

... : gnu.org/copyleft/gpl.html ======================================================================== Flashcards is a command line utility written in python. It is designed to help you study with virtual flashcards. read more

tkinter text widget help - Python

Came across these links and thought I would put them out for people to get involved in! This first one is a facebook page that Brian is apart of, hes trying t… read more

Related Posts



0 コメント:

コメントを投稿