title: How to make this nested for loop function correctly
body: <p>I am trying to create this differential calculator and when I go to calculate the the monthly payment and insert the month count into the format string, it keeps creating a repeat per each month and not creating successive month payments, or it just makes the code not output anything. I really want to figure this out on my own, so if anyone could point me in the right direction for this that would be great. Thanks in advance!</p>
  <pre><code>def diff_calc():
      # create alias for all parsed arguments for cleaner code
  
      loan_type = args.type
      payment = args.payment
      principal = args.Principal
      periods = args.periods
      interest = args.interest
  
      if args.interest is None:
          interest = 10
      if args.Principal is None:
          principal = 1000000
      if args.periods is None:
          periods = 10
  
      i = (interest / (12 * 100))
      overpayment = (principal * i)
      for m in range(1, periods + 1, 1):
          while m &lt;= periods:
              Dm = ((principal / periods) + i * (principal - (principal * (m - 1)) / periods))
              print(f'Month {m}: payment is {Dm}')
  </code></pre>