Untitled

mail@pastecode.io avatar
unknown
python
7 months ago
824 B
1
Indexable
Never
def display_loans():
    mycursor.execute("SELECT * FROM Loan")
    rows = mycursor.fetchall()

    if not rows:
        print("No loan records found.")
    else:
        print("Loan Details:")
        for row in rows:
            if len(row) >= 9:
                print("Account Number:", row[0])
                print("Loan Amount:", row[1])
                print("Profit Rate:", row[2])
                print("Time Period (Months):", row[3])
                print("Loan Type:", row[4])
                print("Customer Salary:", row[5])
                print("Final Amount:", row[6])
                print("Total Profit:", row[7])
                print("Last Payment Date:", row[8])
                print("\n")
            else:
                print("Incomplete data in row:", row)

display_loans()
Leave a Comment