Python

A few years ago, I set out to become fluent in Java, a programming language valued for its simplicity and applicability to a modern computing society. This usefulness is underscored by its presence within almost every computing platform – from smart phones to traffic light control systems. However, when starting classes within my concentration (major) of CS, I have been progressively gaining knowledge on a new language – Python. While more “modern” than Java, some of the conventions within Python (such as automatic determination of variable types, etc.) can be quite unnerving. Below, I have included a few lines within one of the first (and extremely simple) program I have written in Python. 

 

def StudentLoanCalculator():
interestRate = input("Please enter the interest rate of your loan (as a number). ")
initialBalance = input("Please enter the initial balance on the loan. $ ")
interestRate = interestRate*.01;
time = input("Please enter the amount of time (in years) you wish to wait to pay off the loan. ")
payoffBalance = (time*(initialBalance*interestRate))+initialBalance;
print "You must pay: $" +str(payoffBalance) + "0"
StudentLoanCalculator()
Advertisements