0% found this document useful (0 votes)
183 views

IP Practical File Class 11 Term 2

The document contains 10 questions about writing Python programs to perform various operations on lists and dictionaries. The questions cover reversing, concatenating, and modifying lists; converting lists to dictionaries; merging dictionaries; extracting keys from dictionaries; deleting keys from dictionaries; checking for values in dictionaries; renaming keys in dictionaries; getting the minimum value key from a dictionary; changing values in nested dictionaries; and initializing a dictionary with default values.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
183 views

IP Practical File Class 11 Term 2

The document contains 10 questions about writing Python programs to perform various operations on lists and dictionaries. The questions cover reversing, concatenating, and modifying lists; converting lists to dictionaries; merging dictionaries; extracting keys from dictionaries; deleting keys from dictionaries; checking for values in dictionaries; renaming keys in dictionaries; getting the minimum value key from a dictionary; changing values in nested dictionaries; and initializing a dictionary with default values.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Q1. Write a program that reverses a list of integers (in place).

Q2. Write a program that inputs two lists and creates a third, that
contains all elements of the first followed by all elements of the second.

Q3. write a program to turn every item of a list into its square.

Q4.write a program to
concatenate 2 lists
in loop.
Q5. Write a program to iterate
both lists
simultaneously and
display items from
list1 in original order
and items from list2 in reverse order.

Q6. WAP to remove empty strings from the list of strings.

Q7. Write a program to find value 20 in the list, and if it is present,


replace it with 200. Only update the first occurrence of an item. Given-
list1 = [5, 10, 15, 20, 25, 50, 20] .

Q8. WAP to remove all


occurrences of a specific item
from a list.

Q9. Write a program to extend it by


adding the sublist.
Q10. Write a program to add two lists index-wise.

Q1. Write a
Python program to
convert them into a dictionary in a way that item from list1 is the key

and item from list2 is the value.

Q2.WAP to merge two Python dictionaries into one. Given lists-dict1 =


{'Ten': 10, 'Twenty': 20, 'Thirty': 30}

dict2 = {'Thirty': 30, 'Fourty': 40, 'Fifty': 50} expected output-

{'Ten': 10, 'Twenty': 20, 'Thirty': 30, 'Fourty': 40, 'Fifty': 50}
Q3. Write a Python program to create a new dictionary by extracting
the mentioned keys from the below dictionary.

sample_dict = {"name": "Kelly","age": 25, "salary": 8000,"city": "New


york"}

Q4. WAP
to delete a
list of keys
from a
dictionary.

Q5. Write a Python program to check if a value exists in the following


dictionary.
Q6. Write a program to rename a key city to a location in the following
dictionary.

Q7.WAP to get the key of a minimum value from a dictionary.

Q8.wap to change value of a key in a nested dictionary.


Q9.WAP to print the value of key ‘history’ from the below dict.
Given- sampleDict = { "class": { "student": {"name": "Mike","marks":
{"physics": 70,"history": 80}}}}

Q10.WAP to initialize dictionary with default values.

You might also like