National Level Quiz Competition on Python Programming
National Level Quiz Competition on Python Programming Organized by Internal Quality Assurance Cell & Department of B.Sc. (Information Technology) Thakur Shyamnarayan Degree College. In this quiz competition anyone can participate. There is no any registration fee . There is no any time limit . There is total 25 MCQ . There is no any negative marking .
After Quiz Completion Everyone Will Receive A Participation Certificate On Your Email Id.
Here You can sell all the questions and answers which are asked in this quiz competition
1. Name the python module which supports regular expressions.
regex
re
pyre
pyregex
2. Select the correct function among them which can be used to write the data to perform for a binary output?
Write
Output.Binary
Dump
Binary. Output
3. Which can be an Identifier among them in Python?
1abc
$12a
_xy1
@python
4. Suppose you are given a set (s1={1,2,3}) then what is the output for the code?
Illegal
(1,1,2,2,3,3)
[1,1,2,2,3,3]
(1,2,3,1,2,3)
5. Select the correct code to create a button under a parent window with commandprocessButton.
Button(set.text=”Hello”)
Button(Window,text=”OK”, fg=”black”)
Button(window, text=”Hello”, command=processButton)
Button( text=”Hello”, command=processButton)
6. Which of the following operator in python evaluates to true if it does not finds a variable in the specified sequence and false otherwise?
**
//
is
not in
7. Which of the following function removes all leading and trailing white space in string?
replace(old,new,[max])
strip([chars])
swapcase()
title()
8. What is the output of ['Hi!'] * 4?
[Hi!,Hi!,Hi!,Hi!]
[‘Hi!’]*4
Error
None of the above
9. If
A=set('python')
B=set('programming')
Then what will be the output of
print(A-B) ?
{'m', 'r', 'i'}
{'m', 'r', 'g', 'a', 'i'}
{'h', 'y', 't'}
{'y', 'h', 't', 'a'}
10. In Python 'And' and 'Or' operators are also called:
Short circuit operators
Logical operators
Both A and B
None of the above
11. How do you declare a dictionary in python?
dict [“key”:”value”]
dict = {“key”:”value”}
Dict = {“key” - “value”}
Dict = [“key”:”value”]
12. What is the output of the following? print("Hello {0!r} and {0!s}".format('foo', 'bin')).
Hello foo and foo
Hello ‘foo’ and foo
Hello foo and ‘bin’
Error
13. What is the output of the following program?
D={1:{'A':{1:"A"},2:"B"},3:"C", 'B':"D", "D":'E'}
print(D[D[D[1][2]]], end="")
print(D[D[1]["A"][2]])
DC
EB
DB
Key Error
14. What is the output of the following?
print('The sum of {0} and {1} is {2}'. format(2,10,12))
The sum of 2 and 10 is 12
Error
The sum of 0 and 1 is 2
None of the above
15. Which of the following data types is not supported in python?
Numbers
String
List
Slice
16. Which of the following function convert an object to a string in python?
int(x [,base])
long(x [,base] )
float(x)
str(x)
17. Which of the following function gets a space-padded string with the original string left-justified to a total of width columns?
isupper()
join(seq)
len(string)
ljust(width[, fillchar])
18. Which Of The Following Keywords Mark The Beginning Of The Class Definition?
def
return
class
All of the above
19. What is the output of the following code?
>>>list=['a','b','c']
>>>list+='de'
>>>print(list)
[‘a’, ‘b’, ‘c’, ‘d’, ‘e’]
[‘a’, ‘b’, ‘c’, ‘de’]
[‘ade’, ‘bde’, ‘cde’]
This raises an exception because we cannot add a string to a list
20. What is the output of the following code?
>>>val=154
>>>while(not(val)):
val**=2
else:
val//=2
>>>print(val)
77
154
11858
The code will raise exception
21. What will this code print?
>>> from random import randint
>>> for i in range (5):
print(random(1,5))
Five random numbers in the range 1 to 4
Five random numbers in the range 1 to 5
Five random integers in the range 1 to 4
The code will raise exception
22. What is the maximum possible length of an identifier?
16
32
64
None of these
23. In which language is Python written?
English
PHP
C
All of the above
24. What do we use to define a block of code in Python language?
Key
Brackets
Indentation
All of the above
25. What is the method inside the class in python language?
Object
Functions
Attribute
Argument
Quiz Link : Click Here
0 Comments