Question: Python 3.8 Problem 1 (2 point): Write a Python program to compute the sum of all the elements of each tuple stored inside a list
Problem 1 (2 point): Write a Python program to compute the sum of all the elements of each tuple stored inside a list of tuples Example 1: Original list of tuples: [(1,2), (2,3), (3,4)). Sum of all the elements of each tuple stored inside the said list of tuples: [3, 5, 7] Example 2: Original list of tuples: [(1,2,6), (2,3,-6), (3,4), (2,2,2,2)). Sum of all the elements of each tuple stored inside the said list of tuples: [9, -1,7, 8] Problem 2 (3 points): Write a Python program to print a specified list after removing the Oth, 4th and 5th elements. Example 1: Sample List : ['Red', 'Green', 'White', 'Black', 'Pink', 'Yellow'] Expected Output: ['Green', 'White', 'Black'] Problem 3 (4 points): Write a Python program to convert list to list of dictionaries. Example: Sample lists: ["Black", "Red", "Maroon", "Yellow"], ["#000000", "#FF0000", "#800000", "#FFFF00"] Expected Output: [{"color_name': 'Black', 'color_code': '#000000'}, {'color_name': 'Red', "color_code': '#FF0000'}, {'color_name': 'Maroon', 'color_code': '#800000'}, {'color_name': 'Yellow', 'color_code': '#FFFF00"}] Problem 4 (3 points): Write a python program to find the longest words. Problem 5 (4 points): Write a Python program to count the frequency of words in a file. Problem 6 (4 points): Write a Python program to copy the contents of a file to another file
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
