Question: Code the following using python idle and be sure not to use the constructs in the prohibited list unless specified in the question. Note: 0
Code the following using python idle and be sure not to use the constructs in the prohibited list unless specified in the question.
Note: 0 is neither positive or negative, so if a function requires a positive input and does not explicitly state zero, then zero is invalid. Also, many of these problems accept a percentage as one of their arguments. All of these problems will expect the percentage to be an integer on the interval [0, 100]. For example, 6% would be represented as 6. You will probably need to convert this to .06 by dividing by 100 within the function itself before performing any calculations.


26. Lowest Score Drop Write a function called lowest_d rop which takes a list of positive floats as a parameter. Your function should return the average of these numbers after eliminating the smallest one. Do not use the built-in min function. lowest_drop ([75,80,60,100,100,85]) \# output: 88.0 27. Star Search A particular talent competition has five judges, each of whom awards a score between 0 and 10 to each performer. Fractional scores, such as 8.3, are allowed. A performer's final score is determined by dropping the highest and lowest score received, then averaging the three remaining scores. If there are multiple copies of the highest or lowest score, only drop one of them. Write a function star_search that takes the list of scores awarded by all the judges and return the final score of the performer. star_search ([8,9,7.5,6,8]) output: 7.833333... 28. Primality Testing A prime number is an integer greater than 1 that is evenly divisible by only 1 and itself. For example, the number 5 is prime because it can only be evenly divided by 1 and 5 . The number 6 , however, is not prime because it can be divided by 1,2,3, and 6. Write a function named is_prime which takes a positive integer as an argument and returns boolean True if the argument is a prime number, and boolean False otherwise. is_prime(127) \# output: True is_prime(25) \# output: False 29. Present Value Suppose you want to deposit a certain amount of money into a savings account and then leave it alone to draw interest for the next 10 years. At the end of 10 years ( 120 months) you would like to have $10,000 in the account. How much do you need to deposit today to make that happen? To find out you can use the following formula, which is known as the present value formula, P=(1+i)tF where P is the present value (amount you need to deposit today), F is the future value you want in the account, i is the monthly interest rate, and t is the amount of time you plan to let the money sit in the account (in months). Write a function called present_va lue which takes the future value, monthly interest rate, and number of years the money will grow as three arguments. The function should return the present value, which is the amount that you need to deposit today to have the specified future value. present_value (10000,3,10) \# output: 288.09 directions. Using the following constructs will result in 0 (zero) for the entire submission (assignment, timed test, etc.). The restricted items are as follows: - Concepts not discussed in lectures yet - String functions - Member functions - Exceptions (can use) : /en () and x=x+[y1,y2,y3] - Built-in functions \& types - Exceptions (can use): str( ), readline( ), open(), close( ), write(), read(), range( ), .split() - Cannot use .append, .sort, etc. - Cannot use "Slicing" - Cannot use "list comprehension" - Cannot use "not in" (together) - Cannot use "in" - not allowed with conditionals - Exception (can use): with range () - Cannot use and \{\} - Exception (can use): mathematical operations (multiply \& exponents) - Data type functions - Exceptions (can use): int (), str (), float () - Break - Continue - Nested Constructs - Exceptions (can use): 2-D list - Multiple returns \& Multiple assignments - Recursion (not allowed unless the question explicitly states otherwise) - Functions within functions (Definitions) -- invocation is fine - Default Parameters - Global variables - Keyword as variable names
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
