Question: Create a variable intro _ e _ count that stores the number of times the letter ' e ' ( lower - case only )
Create a variable introecount that stores the number of times the letter lowercase only appears in the myintro variable. Find
a string method that will "count" the occurences. Print the variable after you create itpt
Part Money
Define a function compoundinterest that takes three numbers as arguments: an initial bank balance principle in dollars an annual
interest rate as a decimal, so use as and a number of years. The function should calculate the continuous compound interest and
return the resulting total balance after that many number of years. pt
See here for an example of the formula and a calculator you can use to check your work.
Be sure and call your function with some testing numbers: $ at for years should lead to a balance of $
You will need to import the math module for mathematical functions.
Define a function printearnings that takes three numbers as arguments: an initial principle, an annual interest rate as a decimal, so
use as and a number of years. This function should print out the earnings over this period in the following format:
Initial principle: $
Annual interest rate:
Interest earned in years: $
Total value after years: $
You must use your previous compoundinterest function to calculate the amounts; don't write the same equation more than once! Note
that interest rate should be printed as a percentage, monetary values should have a leading $ and you should round monetary values to the
nearest penny. Don't worry about extra or missing trailing s in values like or $pt
Define a function valueofchange that takes in named arguments representing amounts of different US coins quarters dimes,
nickels, and pennieseach of the arguments should have a default value of The function should return the total value in dollars of
those coins. For example, quarters, dimes, nickels, and pennies have a value of dollars. pt
Hint: add up all of the "cents" and then convert that into a number of dollars
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
