WorksheetsPYTHON Q-4
Total questions: 15
Worksheet time: 18mins
Predict the output:
m=[1,3,4,5,6]
print(m[-2])
5
6
4
Error
What is the purpose of 'pip list'
used to display list of installed packages
used to list out .py file directories
used to list keywords in Python
used to install list of packages in python
What is the abbrevation of 'pip'
Package Installer for Python Packages
Package Inisde Package
Python Installed Packages
Package installer for Packages
Which of the following namespace is invalid in python
local
global
builtin
user
What is the the output format of 'locals()' method
dictionary
list
tuple
set
What is the output of the following code:
m=[2,3,3,45,"It"]
print(m.pop())
It
2
None
Error
Predict the output:
def HelloGec():
a=10 #with in def
b=20 # within def
print(locals()) #within def
HelloGec() # in main() calling
a,b
{'a': 10, 'b': 20}
10,20
a=10
b=20
None
Which of the following statment(s) is/are correct
I) Python Package is a Directory which contains Python modules
II) Python module contains Packages.
Only I
Only II
Both I and II
Neither I nor II
Which of the following list is Invalid list.
p=[1,2,'gec',]
v=[[1,2,3],[3,4]]
v=[['KGF'],[ ],]
v=[5,'abc','hai:44']
None of the answers
Predict the output of the following code:
m=[i*i for i in range(10,1) if(i%2==1)]
print(m)
[ ]
Infinite
[1,9,25,49,81]
[81,49,25,9,1]
What is the output of the following code:
m=[3,5,6,76]
k=[1,3,4]
print(m<k)
False
True
Error
None
What is the output of the following code:
PANINDIA=["RRR","KGF-2","Bahubali"]
print("+".join(PANINDIA),'=PANINDIA')
RRR+KGF-2+Bahubali
Error
RRR+KGF-2+Bahubali =RRR+KGF-2+Bahubali
RRR+KGF-2+Bahubali =PANINDIA
What is the output of the following code:
m=[1,2,0,-1]
for x,y in enumerate(m):
print(m[y]+m[x])
3
2
1
-2
1
3
2
2
Error
1
2
0
-1
Predict the output:
IT=[x for x in range(5) if((x&1)==0)]
print(IT)
0
2
4
Error
IT
0
1
2
3
4
5
What is the Output of the Following code:
Nuvvu=['IT']
Nenu=['CSE']
Manam=2*Nuvvu*2+Nenu*4
print(Manam[::-1][3]+Manam[3])
CSEIT
[CSE,IT,CSE]
Error
Naku Teleedu, Nenu Chadavaledu
[CSE,CSE,IT,IT]
