Skip to content

Commit

Permalink
list programs
Browse files Browse the repository at this point in the history
  • Loading branch information
linrakesh committed Dec 24, 2019
1 parent fba6888 commit 1ddf82b
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
21 changes: 20 additions & 1 deletion Loops/tempCodeRunnerFile.py
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)
15 changes: 15 additions & 0 deletions list/shifting_number.py
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)
1 change: 1 addition & 0 deletions list/tempCodeRunnerFile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[-2, 1, -3, -15, 16, -17, 5, -3, -6]

0 comments on commit 1ddf82b

Please sign in to comment.