Class 12 CS Chapter 2 Back Exercise Part C Solutions Sumita Arora New Syllabus / listing12CSSA, Uncategorized / By Neha 1. Write a program that prompts for a phone number of 10 digits and two dashes, with dashes after the area code and the next three numbers. For example, 017-555-1212 is a legal input. Display if the phone number entered is valid format or not and display if the phone number is valid or not (i.e., contains just the digits and dash at specific places). # Code ...click here for answer 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 ...click here for answer 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 ...click here for answer 2. 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 ...click here for answer 4. Write a program that rotates the elements of a list so that the element at the first index moves to the second index, the element in the second index moves to the third index, etc., and the element in the last index moves to the first index. # Code ...click here for answer 5. Write a short Python code segment that prints the longest word in a list of words. ...click here for answer 6. Write a program that creates a list of all the integers less than 100 that are multiples of 3 or 5. ...click here for answer 7. Define two variables first and second so that first = “Jimmy” and second = “Johny”. Write a short Python code segment that swaps the values assigned to these two variables and prints the results. # Code ...click here for answer 8. Write a Python program that creates a tuple storing first 9 terms of Fibonacci series. # Code ...click here for answer 9. Create a dictionary whose keys are month names, and whose values are the number of days in the corresponding months. ...click here for answer 10. Write a function called addDict(dict1, dict2) which computes the union of two dictionaries. It should return a new dictionary, with all the items in both its arguments (assumed to be dictionaries). If the same key appears in both arguments, feel free to pick a value from either. # Code ...click here for answer 11. Write a program to sort a dictionary’s keys using Bubble sort and produce the sorted keys as a list. ...click here for answer 12. Write a program to sort a dictionary’s values using Bubble sort and produce the sorted values as a list. ...click here for answer