Solution Ut-Ii
Solution Ut-Ii
COMPUTER SCIENCE
CLASS XI
Q2: How is the pop() method different from the del statement in dictionaries?
The pop() method removes an item by its key and returns its value, while the del statement
deletes an item by its key without returning the value. If the key does not exist, pop() raises a
KeyError but can take a default argument to return; del raises an error if the key is not found.
t = (1, 2, 3)
a, b, c = t
print(a, b, c) # Output: 1 2 3
Q7: Python program to create a new list with even numbers from two input lists.
even_numbers = []
char_count = {}
if char in char_count:
char_count[char] += 1
else:
char_count[char] = 1
for i in student_names: