2 BE C

3. Write a program that takes any two lists L and M of the same size and adds their elements together to form a new list N whose elements are sums of the corresponding elements in L and M. For instance, if L = [3,1,4] and M = [1, 5,9], then N should equal [4, 6, 13].

# Code L = list(map(int, input(‘Enter list of integers : ‘).split())) M = list(map(int, input(‘Enter list of integers : ‘).split())) if len(L) = len(M): N = [L[i]+M[i] for i in range(len(L))] print(N)

3. Write a program that takes any two lists L and M of the same size and adds their elements together to form a new list N whose elements are sums of the corresponding elements in L and M. For instance, if L = [3,1,4] and M = [1, 5,9], then N should equal [4, 6, 13]. Read More »

3. Write a program that should prompt the user to type some sentence(s) followed by “enter”. It should then print the original sentence(s) and the following statistics relating to the sentence(s) :

* Number of words * Number of characters (including white-space and punctuation) * Percentage of characters that are alpha numeric Hints * Assume any consecutive sequence of non-blank characters is a word. # Code s = input(‘Enter a sentence : ‘) number_of_words = 1 number_of_characters = len(s) al_num = 0 for i in s: if

3. Write a program that should prompt the user to type some sentence(s) followed by “enter”. It should then print the original sentence(s) and the following statistics relating to the sentence(s) : Read More »