Xi - Ip (Slip Test)
Xi - Ip (Slip Test)
1 To find the second element of list namely ‘smiles’ in Python, _____ will be used. 1
a) smiles[0] b) smiles[1]
c) smiles[-2] d) smiles[:]
2 What is the output of the following 1
l = [None] * 3
print(l))
a) [None, None, None] b) 0 c) Syntax Error d) None
3 What would the following code print? 1
d = {'spring': 'autum', ‘autumn’:’ fal’, ‘fall’:’spring’}
print (d[fall])
a) autumn b) fall c) spring d) Error
4 To create a table we will use 1
a) Create command b) Insert command c)Select command d) None of all
5 What is printed by the following statements ? 1
D1 = {"cat":17, "dog":6, "elephant":23, "bear":20}
print (23 in D1)
a)True b)False c)Error d) None
6 Which of the following will return the length element of a list L? 1
a) len(L) b) len.L[] c) L.len() d) len()
7 Given a list L = [10, 20, 30, 40, 50, 60, 70], what would L[ :4] return? 1
a) [10, 20, 30, 40] b) [20, 30, 40, 50]
c) [20, 30, 40] d) [30, 40, 50]
8 Given a list L = [10, 20, 30, 40, 50, 60, 70], what would L[2: ] return? 1
a) [10, 20, 30, 40] b) [20, 30, 40, 50]
c) [20, 30, 40] d) [30, 40, 50]
9 Which command is used to describe our table? 1
a) Show b) Use c) Describe d) Create
10 Which of the following functions will return the key, value pairs of a dictionary? 1
(a) keys() b) values() c) items() d) all of these
SECTION B
11 WAP to write a length of the given list l = [1,2,3,4,5,6] 2
OR
Write a Output of the following program:
A= [45,56,67,78,89,90,100,12,130,156,167,178]
print(A[:6])
print(A[4:7])
12 Rewrite the following program code using a for loop: 2
i=1
sum = 0
while ( i < 10 ):
sum += i; i += 2
13 How to concat 2
14 2
Page 1 of 3
15 2
SECTION E
33 i)WAP for List manipulation. (Any five) 5
OR
ii) Write a python code to print factorial of first 5 numbers.
34 Write the system for the following SQL command: 5
Page 2 of 3
i) Create table ii) insert values iii) rename column name
iv) modify the data type v) add primary key
35 Write SQL commands for the following table MOVIE: 5
NO TITLE TYPE RATING SEATS_LEFT PRICE
1 ARMY PATRIOTIC A 4 250
2 AIR FORCE ACTION B 2 175
3 RACE ACTION C 7 245
4 TIRANGA PATRIOTIC A 3 130
i) Display the list of movies with price over 200 rupees and sorted by rating.
ii) Display a report listing the movie number, price from the table movie.
iii) Display the number of seats left for action movies.
iv) Delete all the movies from the table with rating ‘C’.
v) Display all the tuple form table movie.
Or
Explain the use of the following Dictionary Methods with example.
i) clear() ii) items() iii) Dict() iv) get() v) Values()
Page 3 of 3