Subject: Informatics Practices
Class XI
Time Allowed: 3 hours
Max. Marks: 70
Q1. a) Suppose list1 is [2, 33, 222, 14, 25], What is list|-1|?
b) If list1= [11,2,23] and list2= [11,2,2], What will be the output of print(list1<list2)?
c) Write the output of the following code: list(“welcome”)
d) What is the correct way to get minimum value from a list in python?
i) print(minimum(mylist))
ii) print(mylist.min())
iii) print(min(mylist))
iv) print(mylist.minimum())
e) Find the output of the following statements:
listl=range(100,110)
print(list1.index(105))
i) 105
ii) 106
iii) 5
iv) 104
Q2. What is the difference between append () and extend () functions in python’s list?
Q3. Define list and Dictionaries with an example of each?
Q4. Write the function’s names and examples of dictionaries to do the following operations:-
a. To find the key’s names in dictionary
b. To modify the contents of dictionaries
c. To count no. Of items in dictionaries.
Q5. Write a python program to print sum of even and odd numbers between 1 to 50.
Q6. Write any 3 features of python programming?
Q7. Fill in the blanks:
a. Python is a __________ programming language
b. Python supports ______ and ________ modes.
Q8. a) Which of the following is valid logical operator in Python:
i) +=
ii) ?
iii) >=
iv) and
b) Write the type of tokens from the following:
i) for
ii) name
c) What do you understand by the term Loop?
d) Define comments and its type also.
e) Explain tuple data types in python?
Q9. Rewrite the following cade in python after removing all syntax error(s). Underline each correction done in the code.
10,20=a,b
For X between 20 to 1
IF a=b
Print (X)
Else
Print (X*2)
Q10. Write a python program to check entered year is leap year or not.
Q11. Write a python program to find the greatest number between 3 numbers.
Q12. Write a python program to check whether a number is divisible by 5 or 16 or not.
Q13. Write a python program to check given character is vowel or not.
Q14. Write a python menu driven program to calculate:
i. factorial of a number
ii. swapping of 3 variables
Q15. Given the following definitions: a,b=12,7 evaluate the following Boolean expressions:
i. a<=b
ii. a=b
iii. a!=b+4
iv. a>=0 and a<=5
Q16. Write a python to input Eng, Maths and Science subject’s marks and assign the stream in a variable as per following conditions: –
Marks obtained in different subject | Stream |
Eng, Maths and Science>=70 | Science 1 |
Eng or Science or Maths>=60 | Science 2 |
Q17. Consider the following Python code fragment:
a,b=0,1
print(a,b,end=” “)
while b<13
a,b = b,a+b
print(b,end=” “)
Q18. Given the following definitions: a1, a2, a3, a4=1, true, x==7, y<4. Evaluate the following Boolean expressions:
a. not a1 or not a2 or not a3
b. not (not a1 and not a2 and not x)
Q19. Find Output: if i2 = 6, i3 = 12, i1 = 4, d1=-12, d2 =8, d3 = – 0.9
i. i1 * (i2 – i3)
ii. i1 / (i2 * i3)
iii. i1 // (i2 + d1)
iv. 7/(d1 **d2) + (d1 – d3)
Q20. Write a python program to display the table of any number entered by the user.
e.g. Enter the no.: 4
4 8 12 16 20 24 28 32 36 40
Q21. Define range0 and in operator in python?
Q22. Write the difference between Mutable and Immutable data types?
Q23. Define decision control statements with an example?
Q24. Write a python program to Create a list to store teacher’s names and count the number of records