Just a random code I made when got nothing to do, figured might have to count money stuffs sooner or later.
a = raw_input("First price")
b = raw_input("Second price")
c = raw_input("Third price")
try:
a = float(a)
if a < 0:
print "Please enter positive values"
exit()
b = float(b)
if b < 0:
print "Please enter positive values"
exit()
c = float(c)
if c < 0:
print "Please enter positive values"
exit()
except:
print "Invalid"
exit()
def ExtraCost(a,b,c):
cost = a + b + c
gst = cost * 0.07
svc = cost * 0.1
print "Intial cost is $" + `round(cost, 2)`
print "GST is $" + `round(gst, 2)`
print "Service charge is $" + `round(svc, 2)`
total = cost + gst + svc
return round(total, 2)
print "Final cost is $" + `ExtraCost(a,b,c)`