Selfstudys Com File
Selfstudys Com File
(From this portion as per sample paper all the Questions are of 1 mark)
• As basic questions will be asked from this portion so all the question
Q1. Following set of commands is executed in Python shell ,what will be the output ?
>>>str=”welcome”
>>>str[:3]
(a) wel (b) ome (c) wce (d) welcome
Q2. What is the data type for the object L below in python?
L=1,4,’thanks’,34
(a) list (b) dictionary (c) tuple (d) array
Q3. To store value in terms of key and value , what core data type does Python provide?
(a) List (b) tuple (c) class (d) dictionary
Q6. Suppose a tuple T is declared as T = (10, 12, 43, 39), which of the following is
incorrect?
a) print(T[1])
b) T[2] = -29
c) print(max(T))
d) print(len(T))
Q8. If the following code is executed, what will be the output of the following code?
name="ComputerSciencewithPython"
print(name[3:10])
Q9. A tuple is declared as
T = (12,4,7,8,5)
What will be the value of sum(T)
Q10. To store in terms of key and value, what core data type does python provide?
(a) list (b) tuple (c) class (d) dictionary
Q11. Write a statement in Python to declare a dictionary whose keys are 1, 2, 3 and values
are January, February and March respectively.
Q12. Given the lists L=[10,30,16,8,50,17,12,42] , write the output of print(L[2:5])
Answer Key
1.(a) 9. 36
2. (c) 10. (d)
3.(d) 11. Month={1:'january',2:'february',3:'march'}
4.(a) 12. [16, 8, 50]
5(c) 13. 30
10
6.(b) 14. r
P
7.(d) 15. 5
8. puterSc 16.(c)