Rate=float(input("The rate of interest is "))
Loan=float(input(“The amount of loan is RM”))
print(“Press F for flat interest”)
print(“Press O for interest on balance”)
Type=str(input("The type of loan interest is "))
if (Type==“F” or Type==“f”):
Years=float(input("The loan period by years is "))
print(“The Monthly instalment is RM”,(Flat_monthly_payment)
elif (Type==“O” or Type==“o”):
Months=int(input("The loan period by months is "))
Monthly_installment=float(input(“The monthly installment is RM”))
for x in range (Months):
print(No_month,“month is RM”,Current_monthly_payment)
Hello, @albertwek. Welcome to the forum.
Code that is posted without the indentations preserved, is not Python. Indentations are not optional in Python, but are rather an essential part of the language , lacking which your code will not run at all.
Unindented code is difficult to read, requires guesswork concerning your intent, and cannot be copied and pasted for testing, both because it is unindented and because it often contains characters such as left-and right double-quotes that are unreadable to the Python interpreter.
The Codecademy forum provides a quick and easy way to post properly-formatted code. All you need to do is look for the </> icon in the menu bar which appears at the top of the text box while you type.
Press Enter to go to a blank line, click that icon, and you will see this:
Just copy and paste your code directly from the editor into that highlighted portion, and all of the nicely-readable Python formatting will be preserved! Moreover, it will be in a format that can be directly copied and pasted into a Python IDE for testing.
The same icon can be used for highlighting small code snippets in-line for clarity.