Skip to content

Task 1: Write a Python program to create a tuple with different data types. Task 2: Write a Python program to print all unique values in a dictionary. Go to the editor Sample Data : [{"V":"S001"}, {"V": "S002"}, {"VI": "S001"}, {"VI": "S005"}, {"VII":"S005"}, {"V":"S009"},{"VIII":"S007"}] Expected Output : Unique Values: {'S005', 'S002', 'S007',…

Notifications You must be signed in to change notification settings

Hussain6/Python-List-Dictionary-Set-Questions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Task 1: 
Write a Python program to create a tuple with different data types. 
Task 2: 
Write a Python program to print all unique values in a dictionary. Go to the editor 
Sample Data : [{"V":"S001"}, {"V": "S002"}, {"VI": "S001"}, {"VI": "S005"}, 
{"VII":"S005"}, {"V":"S009"},{"VIII":"S007"}] 
Expected Output : Unique Values: {'S005', 'S002', 'S007', 'S001', 'S009'} 
Task 3: 
Write a Python program to create and display all combinations of letters, selecting each letter from a different key in a dictionary. Go to the editor 
Sample data: {'1': ['a', 'b'], '2': ['c', 'd']} 
Expected Output: 
ac 
ad 
bc 
bd 
Task 4: 
Find the series of Fibonacci numbers using lambda function. 
Task 5: 
Write a list comprehension which, from a list, generates a lowercased version of each
string that has length greater than five. 
Task 6: 
Let we have a dictionary D which contain roll number of students as key and its values 
shall be a list. The list has tuples as its item. Each tuple represents the name of the subject 
and gpa of that subject. You can visualize the data structure as of following: 
Key Value 
2016-CS-700 [(DSA,3), (Algo,2.5), (AI,3)] 
2016-CS-701 [(LA,3), (Algo,3.5), (PF,2.8)] 
… … 
… .. 
2016-CS-710 [(OOP,3), (DB,3.5), (PF,2.8)] 
a) Write a program which shall print GPA of all students. Assume all subject have 3 credit 
hours. (with and without using for loop) 
b) Write a program that print the highest number obtained in DSA (with and without using 
for loop) 
c) Write a program that print the total number of students those have less than 2.5 GPA in 
AI? (with and without using for loop)

About

Task 1: Write a Python program to create a tuple with different data types. Task 2: Write a Python program to print all unique values in a dictionary. Go to the editor Sample Data : [{"V":"S001"}, {"V": "S002"}, {"VI": "S001"}, {"VI": "S005"}, {"VII":"S005"}, {"V":"S009"},{"VIII":"S007"}] Expected Output : Unique Values: {'S005', 'S002', 'S007',…

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages