Question: 1. Given a non-empty string and an integer n, write a function missing_char that returns a new string where the char at index n has

1. Given a non-empty string and an integer n, write a function missing_char that returns a new string where the char at index n has been removed. The value of n will be a valid index of a char in the original string (i.e. n will be in the range 0..len(str)-1 inclusive). Examples: >>>missing_char('kitten', 1) 'ktten >>>missing_char('kitten', 0) 'itten >>>missing_char('kitten', 4) 'kittn 2. Write a function star(s) that takes a string S, and prints a new string where identical chars that are adjacent in the original string are separated from each other by a "*" Examples: >>>star("hello") "hello" >>>star("xxyy") - "x*xy*y" >>>star("aaaa") "a*a*a*a" 3. Consider a text file where each line contains 3 integers separated by commas. For each line, the 1st integer is at position 0, the 2nd integer is at position 1, and the 3rd integer is at position 2. A column of data is defined as all integers in the file with the same position. Write a function ColAvg(F) that takes a filename of the above format and returns a list of the averages of each column. Example: ColAvg ("numbers.txt") => [2,5, 8] numbers.txt 3,2,6 2,3,3 1,10,15 4. Write a function to compute the following summation: 4(1 3 + } - ++- ..........) Hint: the value of this summation is the well-known constant . Show how to handle the infinity number of terms
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
