--
so what exactly is your question about it
As an exercise, write a loop that traverses the previous list and prints the length of each element.?
so what your looking for is a nested loop which is a loop within a loop?
Yup
``` ##calculates minimum fixed monthly payment needed in order to pay off credit card balance within 12 months outstanding_Balance = float(raw_input("Outstanding Balance on Credit Card:")) annual_Interest_Rate = float(raw_input("Annual Interest Rate:")) monthly_Interest_Rate = annual_Interest_Rate / 12.0 monthly_Payment = 0 current_Balance = outstanding_Balance ## while balance not paid off while current_Balance > 0: months = 0 monthly_Payment += 10 while current_Balance > 0 and months < 12: months += 1 current_Balance = current_Balance * (1 + monthly_Interest_Rate) - monthly_Payment ## if balance is paid off, end loop if current_Balance <= 0: print "RESULT:" print "Monthly payment to pay off debt in 1 year:",monthly_Payment print "Number of months needed:",months print "Balance:",round(current_Balance, 2) ``` if you are using python this would be an example of a small program that I recenntly wrote for calculating compound interest. If you look at the first loop it is a while loop that loops the current balance. Then there is another loop 3 lines under it then loops current balance and month this is an example of a nested loop!
this was not the answer to my question...
I gave you an example of a nested loop. The information you gave me isnt sufficient enough for me to give you a anything better. You need to give me more information about what exactly is in this loop you want to write.
Join our real-time social learning platform and learn together with your friends!