

The function should return the value of the investment at the end of the number of years given. The function should take three parameters: the initial investment amount (the principal), the annual interest rate, and the number of years. Write a function to compute the future value of an investment. Keep building your solution so that you can handle a string of any length. Hint: Think about how you can solve the problem for a string with one character, then a string with two characters. This problem is pretty hard, and recursion is the best way to solve it. (The strings in the list can appear in any order.) For example, if you’re given the string 'abc', your function should return the list. Write a function that takes a string named original as a parameter, and produces a list of strings that contains all permutations of the characters in the original string. (a) Do this iteratively with a while loop.

For example, removeNonLetters('? a b c !!!') should return the string 'abc'. Write a function called removeNonLetters(s) that takes one (possibly empty) string as a parameter, and returns a new string in which all the non-letters in the original string are removed. One more hint: for helping to print the words out, you can create a list of 10 strings, the element at index 0 is 'zero', element at index 1 is 'one', and so forth, like: To get the remaining digits, you can divide the number by 10 ( 153/10 is 15).Ī restriction with this function is that you cannot convert the int to a string at any point: you must always work with the number as an int. The function should take one integer as a parameter, and just print the number in English it should not return anything.Īs a hint, to get the rightmost digit of a (base 10) number, you can look at the remainder after dividing by 10 ( 153 % 10 is 3). For example, if the number is 153, the output should be "one five three". Write a recursive function to print out the digits of a number in English. You should not use the ** operator anywhere in your solution.
