Python Test 3 Objective
Python Test 3 Objective
a) yes
b) no
a) UPPER CASE
b) lower case
c) Capitalized
d) None of the mentioned
a) False
b) True
5. Which one of the following has the highest precedence in the expression?
a) Addition
b) Multiplication
c) Exponential
d) Parentheses
a) float
b) bool
c) dict
d) int
7. What is the output of the following? print("Hello {0!r} and {0!s}".format('foo', 'bin'))
a) String
b) Numbers
c) Slice
d) List
9. Which Of The Following Keywords Mark The Beginning Of The Class Definition?
a) return
b) class
c) def
d) All of the above
a) else
b) raise
c) import
d) All of the above
a) Yes
b) no
12. Python allows string slicing. What is the output of below code: s='cppbuzz chicago' print(s[3:5])
a) buzzc
b) pbuzz
c) bu
d) None of these
13. class test: def __init__(self): print "Hello World" def __init__(self): print "Bye World" obj=test()
a) Bye World
b) Hello World
c) Compilation Error
d) Ambiguity
a) list
b) bool
c) int
d) str
a) 32 characters
b) 63 characters
c) 79 characters
d) None of the above
17. Which one of the following is not a python's predefined data type?
a) List
b) Dictionary
c) Tuple
d) Class
a) 13
b) 15
c) 2
d) None of these
19. 19 % 2 in python
a) 2
b) 17
c) None of these
a) /
b) +
c) ()
d) -
a) yes
b) no
1b 2a 3 d 4 a 5 d 6 d 7 b 8 c 9 b 10 d
11 a 12 c 13 a 14 d 15 a 16 d 17 d 18 a 19 c 20 c
21 b