Posts

Showing posts with the label Calculate Simple and Compound Interest

Calculate Simple and Compound Interest

#The User Input is taken using input() function which takes input as a string #We need the input to be a float #We did the type conversion using float() function #The Principal Amount is stored in the variable p p=float( input ( "Enter the Principle Amount : " )) #The Number of Years is stored in the variable n n=float( input ( "Enter the Number of Years : " )) #The Rate of Interest is stored in the variable r r=float( input ( "Enter the Rate of Interest : " )) #Calculate Simple Interest value is stored in the variable s s=(p*n*r)/ 100 #Calculate Compound Interest value is stored in the variable c c=p*( pow (( 1 +(r/ 100 ))...