ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/ns_dev/Python/NinoCode/Active_prgs/SplitTheCheck.py
Revision: 653
Committed: Thu Dec 12 21:00:13 2019 UTC (6 years, 3 months ago) by nino.borges
Content type: text/x-python
File size: 666 byte(s)
Log Message:
simple program to play with splitting a check

File Contents

# Content
1 """
2
3 SplitTheCheck.py
4
5 Created by
6
7 Emanuel Borges
8 04.11.2014
9
10 """
11
12
13 def RatioEquation(subTotalNoTax,finalTotal, individualPerson):
14 return(finalTotal*individualPerson)/subTotalNoTax
15
16 if __name__ == '__main__':
17
18 personA = [2.63,8.99]
19 personB = [8.22,22.33]
20 personC = [5.22,9.99]
21
22 tax = 2.84
23
24 tip = 12
25
26
27 ## Total of all food items without tax and tip
28 subTotalNoTax = 57.18
29
30 ## Final total with everything including tip and tax
31 finalTotal = 72.02
32
33 ## The total for one person without tip and tax
34 singlePersonTotal = 14.95
35
36 print RatioEquation(subTotalNoTax,finaltotal,singlePersonTotal)