class 11 Python practice questions
class 11 Python practice questions
A = [2, 4, 6, 8,10]
L = len (A)
S = 0
for I in range (1, L, 2):
S += A[I]
print("Sum=", S)
3. Write a program in Python to input a list and count the frequency of an element
in that list.
4. Given a list L= [10, 20, 30, 40, 50, 60, 70], what would L[2:-2] return?
5. Start with the list [8, 9, 10]. Do the following using list functions:
9. How you can check the availability of a value in a tuple? Explain all the ways
to check it.
10. What is the significance of this statement with respect to a tuple in python?
1. t=(“T”)
2. t=(“T”,)
3. t=(‘T’,)
1. print(stateCapital.get("Bihar"))
2. print(stateCapital.keys())
3. print(stateCapital.values())
4. print(stateCapital.items())
5. print(len(stateCapital))
12. Condider a dictionary D with 4 key-value pairs. How D.clear() is different from
del D?
13. Write a program to enter roll number and names of five students and store the
data
in dictionary.