[go: up one dir, main page]

0% found this document useful (0 votes)
85 views2 pages

Step 3 B

This document appears to be a practice exam for a Class 12 Computer Science exam covering topics like strings, lists, tuples, and dictionaries in Python. It contains 30 multiple choice questions testing concepts such as string indexing and slicing, list methods, tuple immutability, and dictionary basics. The questions cover Python operations on various data types including addition and replication on strings, list slicing and length, tuple deletion and multiplication, and dictionary key-value pairs.

Uploaded by

SOMKOW
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
85 views2 pages

Step 3 B

This document appears to be a practice exam for a Class 12 Computer Science exam covering topics like strings, lists, tuples, and dictionaries in Python. It contains 30 multiple choice questions testing concepts such as string indexing and slicing, list methods, tuple immutability, and dictionary basics. The questions cover Python operations on various data types including addition and replication on strings, list slicing and length, tuple deletion and multiplication, and dictionary key-value pairs.

Uploaded by

SOMKOW
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

AMRITA VIDYALAYAM, KANYAKUMARI Name of the Student:

SCORE
Fourth Step towards Term 1 Examination ____________________
Class XII - Computer Science (083)

1. Which are stored as individual characters in contiguous locations, with two-way index for each location.
a) lists b) tuples c) strings d) dictionaries
2. What is the output of – “5” + “5” ?
a) 25 b) 55 c) 10 d) error
3. If n=”Hello” and user wants to assign n[0]=’F’ what will be the result?
a) It will replace the first character
b) It is not allowed in Python to assign a value to individual character using index
c) It will replace the entire word Hello into F
d) It will remove H and keep rest of the characters
4. Which of the following operator can be used as replication operator?
a) + b) * c) ** d) /
5. Which point can be considered as difference between string and list?
a) Length b) Indexing and Slicing c) Mutability d) Accessing individual elements
6. In list slicing, the start and stop can be given beyond limits. If it is then
a) raise exception IndexError b) raise exception ValueError
c) return elements falling between specified start and stop values d) return the entire list
7. In list slicing negative index -1 refers to
a) first element b) last element c) second last element d) second element
8. Which of the following operator cannot used with strings?
a) == b) + c) * d) /
9. SreeHari is working on a string program. He wants to display last four characters of a string object named
s. Which of the following is statement is true?
a) s[4:] b) s[:4] c) s[-4:] d) s[:-4]
10. The append() method adds an element at
a) first b) last c) specified index d) at any location
11. Which of the following statement is true for extend() list method?
a) adds element at last b) adds multiple elements at last
c) adds element at specified index d) adds elements at random index
12. The statement del l[1:3] do which of the following task?
a) deletes elements 2 to 4 elements from the list b) deletes 2nd and 3rd element from the list
c) deletes 1st and 3rd element from the list d) deletes 1st, 2nd and 3rd element from the list
13. If l=[11,22,33,44], then output of print(len(l)) will be
a) 4 b) 3 c) 8 d) 6
14. Which of the following method is used to delete element from the list?
a) del() b) delete() c) pop() d) All of these
15. What will be the output of following code: txt="Term 1"
print(txt*2)
a) Term 1 Term 2 b) Term 1Term 1 c) Term 1 2 d) TTeerrmm 11
16. What will be the output of: txt="SQP2021"
if txt.isalnum()==True:
Page No. 1
print("Term 1 sample paper is out now")
else:
print("Term 1 sample paper is not out till now")
a) Term 1 sample paper is not out till now b) Term 1 sample paper is out now
c) SQP2021 d) Error
17. What will be the output of the following statement given:
txt="term 1. sample paper 2021"
print(txt.capitalize())
a) term 1. sample paper 2021 b) Term 1. Sample paper 2021
c) Term 1. sample paper 2021 d) Term 1. Sample Paper 2021
18. Which of the following statement prints output as ‘B’?
a) char(66) b) ord(‘B’) c) char(66) d) chr(66)
19. Which of the following statement(s) is/are correct?
a) Tuples can have only integer elements. b) Tuples can have only string elements.
c) Tuples can have various types of elements d) Tuples can either integer or string, but not both at once.
20. Which of the following statement creates a tuple?
a) t=[1,,2,3,4] b) t={1,2,3,4} c) t=<1,2,3,4> d) t=(1,2,3,4)
21. Which of the following statement is correct?
a) Tuples are mutable. b) Tuples are immutable. c) Tuples and lists are same. d) All are correct.
22. What will be the output of the following code: t=(4,5,6)
t1=t*2
print(t1)
a) (4,5,6,4,5,6) b) (4,4,5,5,6,6) c) (8,10,12) d) None of the above
23. What will be the output of : t=(4,5,6)
del t[1]
print(t)
a) (4,6) b) ([4,6]) c) [4,6] d) Error
24. Which of the following operation is supported in python with respect to tuple t?
a) t[1]=33 b) t.append(33) c) t=t+t d) t.sum()
25. Which of the following statements prints the output (4,5)?
a) print(t[:-1]) , print(t[0:2]) b) print(t[3]), print(t[:-3])
c) print(t[2:3]), print(3:2) d) print(t[0,2]), print[2,3]
26. What will be the output of the following code: t=(4,5,6,7,8,9,3,2,1)
print(t[5:-1])
a) (8,9,3,2,1) b) (9,3,2) c) (4,5,6,7) d) (2,3,9)
27. Dictionaries are also known as ________.
a) mappings b) hashes c) associative arrays d) all of the above
28. Dictionaries are _________ type of python.
a) Mutable b) Immutable c) simple d) complex
29. Siddarth is working with a dictionary in python for his project. He wants to display the key, value pair
but confuse out of these statements, choose the correct statement for him:
a) dict.values() b) dict.keys() c) dict.keysvalues() d) dict.items()
30. The fromkeys() method assigns ________ value to key in dictionary by default.
a) 0 b) None c) Empty d) Blank

Page No. 2

You might also like