forked from sureshb208/Beginners-Python-Examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpercentage_increase_decrease.py
More file actions
16 lines (13 loc) · 619 Bytes
/
percentage_increase_decrease.py
File metadata and controls
16 lines (13 loc) · 619 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# Percantage Increase , Percentage Decrease
def increasePercent(increase , origValue):
return(str(increase / origValue * 100) + '%')
def decreasePercent(decrease , origValue):
return(str(decrease / origValue * 100) + '%')
print('Hello,\nPress Enter To Exit')
incOrDec = str(input('increase or decrease: ')).strip().lower()
if incOrDec == 'increase':
print(increasePercent(float(input('Increased Value : ')) , float(input('Orignal Value : '))))
elif incOrDec == 'decrease':
print(increasePercent(float(input('Increased Value : ')), float(input('Orignal Value : '))))
else:
quit()