-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,21 @@ | ||
# program to find out EMI using formula | ||
# EMI = (p*r(1+r)**t)/((1+r)**t-1) | ||
# made by : rakesh kumar | ||
|
||
r = int(input('Enter rate of interest amount :')) | ||
from math import pow | ||
|
||
|
||
def emi_calculate(p, r, t): | ||
r = r/(12*100) # rate for one month | ||
t = t*12 # one month time | ||
emi = (p*r*pow(1+r, t))/(pow(1+r, t)-1) | ||
return emi | ||
|
||
|
||
if __name__ == "__main__": | ||
p = int(input('Enter pricipal amount :')) | ||
r = int(input('Enter rate of interest :')) | ||
t = int(input('Enter time in years :')) | ||
emi = emi_calculate(p, r, t) | ||
|
||
print('Monthly Installment :%.2f' % emi) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# program to shift positive number at left hand side and negative number at right hand side. | ||
|
||
list1 = [-2, 1, -3, -15, 16, -17, 5, -3, -6] | ||
list2 = [] | ||
n = len(list1) | ||
|
||
for x in range(n): | ||
if list1[x] > 0: | ||
list2.append(list1[x]) | ||
|
||
for x in range(n-1, -1, -1): | ||
if(list1[x]) < 0: | ||
list2.append(list1[x]) | ||
|
||
print(list2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[-2, 1, -3, -15, 16, -17, 5, -3, -6] |