1.Given the dictionary x = {‘k1’: ‘v1’, ‘k2’ : ‘v2’, ‘k3’ : ‘v3’} ,create a dictionary with the opposite mapping, i.e, write a program to create the dictionary as: Inverted_x={‘v1’: ‘k1’, ‘v2’: ‘k2’,...

1.Given the dictionary x = {‘k1’: ‘v1’, ‘k2’ : ‘v2’, ‘k3’ : ‘v3’} ,create a dictionary with the opposite mapping, i.e, write a program to create the dictionary as: Inverted_x={‘v1’: ‘k1’, ‘v2’: ‘k2’, ‘v3’: ‘k3’}2.WAP in Python to add 10 all the odd values and divide by 2 all even values of the list L and display the list.3.Given a list L=[24,52,92,78,12] WAP in Python to display sum of all values which are ending with 2.4.Given a tuple pairs=((2,5),(4,2),(9,21),(12,15)), count the number of pairs (a,b) such that both a and b are divisible by 3.5.Given two dictionaries say D1 and D2. Write a program that lists the overlapping keys of the two dictionaries, i.e., if a key of D1 is also a key of D2, the list it.6.WAP in Python program that creates a tuple storing first 9 items of Fibonacci series.
Sep 02, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here