Sunday, 15 November 2015

THINKING PYTHON..............



THANKS to  "Allen B. Downey"  for your "THINK PYTHON"                     Just a wonderful book for a beginner......  trying to finish it within 1 week :-)



Monday, 14 September 2015

being programmer

My first blog!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
let the topic be the thing which now I'm loving most, PYTHON..
what to say more..IT JUST GOT MY ATTENTION..haha..
here is one my first own python code which predicts your correct annual credit card balance after one year by knowing your how much money you are planned to return in each month

balance =float(raw_input("Let me Know your Primary Credit Balance: "))
annualInterestRate = float(raw_input("Let me Know your Annual Interest Rate: "))
monthlyPaymentRate = float(raw_input("And Monthly Payment Rate also: "))
totalpaid=0
def interest(b,a):
    return (b*(a/12.0))
for i in range(1,13):
    minrate=balance*monthlyPaymentRate
    monthlypaid=int(raw_input("Enter the amount you wish to return in this month"))
    while(monthlypaid<minrate):
        print"SORRY....You have to pay more.\nThe amount is less than",minrate
        monthlypaid=float(raw_input("Enter the amount you wish to return in this month"))
    totalpaid+=monthlypaid
    updatedbal=balance-monthlypaid
    if(updatedbal<=0):
        print"Congrats... you Can Successfully Close the Loan in less tha a year"
        break
    intrst=interest(updatedbal,annualInterestRate)
    balance=balance+intrst-monthlypaid
    print"In month: ",i
    print"Amount Paid: ",round(monthlypaid,2)
    print"Balance: ",round(balance,2)
print"After One year You will have Total paid: ",round(totalpaid,2)
print"Remaining balance will be: ",round(balance,2)