Python int to percent
Question: I need monthlyPayment as percentage so instead of range = [4, 5, 6, 7, 8] I
need range = [0.04, 0.05, 0.06, 0.07, 0.08]

Do you know how to do it, and still get the calculation from totalPayment

    
    
    import math 
    
    loanAmt=int(input("Enter the Amount (greater then 0) of the Loan: "))
    
    numYears=int(input("Enter the number of years as an integer: "))
    
    for monthlyRate in range(4,9):
    
       monthlyPayment = loanAmt * monthlyRate / (1 - math.pow(1 / (1 + monthlyRate), numYears * 12))
    
       totalPayment = monthlyPayment * numYears * 12
       print("{0:.0f}%".format(monthlyRate),'\t','$%.2f' %monthlyPayment,'\t','\t','$%.2f' %totalPayment)
    


Answer: You can use this:

    
    
    for monthlyRate in (x/100.0 for x in range(4,9)):
        print monthlyRate
    
    0.04
    0.05
    0.06
    0.07
    0.08
    

