0% found this document useful (0 votes)
2 views4 pages

Practical 8

The document outlines practical exercises for a Python programming class, focusing on dictionary manipulation. Tasks include sorting dictionaries by value, concatenating multiple dictionaries, combining two dictionaries with common keys, printing unique values from a list of dictionaries, and finding the highest three values in a dictionary. Each task is accompanied by sample data for implementation.

Uploaded by

p2787269
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views4 pages

Practical 8

The document outlines practical exercises for a Python programming class, focusing on dictionary manipulation. Tasks include sorting dictionaries by value, concatenating multiple dictionaries, combining two dictionaries with common keys, printing unique values from a list of dictionaries, and finding the highest three values in a dictionary. Each task is accompanied by sample data for implementation.

Uploaded by

p2787269
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Practical 8

Name-Mrunal Madhukar Gharal. Class-TE6I


Roll No-12 Batch-A
1)Write a Python script to sort (ascending and descending) a
dictionary by value.

2) Write a Python script to concatenate following dictionaries to create a new


one. Sample Dictionary:
a) dic1 = {1:10, 2:20}
b) dic2 = {3:30, 4:40}
c) dic3 = {5:50,6:60}
3) Write a Python program to combine two dictionary adding values for
common keys.
a. d1 = {'a': 100, 'b': 200, 'c':300}
b. d2 = {'a': 300, 'b': 200, 'd':400}

4. Write a Python program to print all unique values in a dictionary. a. Sample


Data: [{"V":"S001"}, {"V": "S002"}, {"VI": "S001"}, {"VI": "S005"}, {"VII":"S005"},
{"V":"S009"}, {"VIII":"S007"}]
5) Write a Python program to find the highest 3 values in a dictionary.

You might also like