All Question of the Quiz Present Below for Ease Use Ctrl + F to find the Question.
Suggestion: If you didn't find the question, Search by options to get a more accurate result.
1.Code written in Python 3 is backward compatible with Python 2.
- True
- False
Answer: 2)False
2.The following options are the salient features of Python except ___________.
- Limited platform support
- Open source
- Broad standard library
- Simple to learn and understand
Answer: 1)Limited platform support
3.Python is ubiquitous. Is this true or false?
- False
- True
Answer: 2)True
4.The two main versions of Python include ___________.
- Python 3.x and 4.x
- Python 3.x and 6.x
- Python 2.x and 3.x
- Python 3.x and 5.x
Answer: 3)Python 2.x and 3.x
5.Python supports automatic garbage collection.
- False
- True
Answer: 2)True
6.Which of the following attributes exhibits Python's characteristics?
- Object-oriented
- Broad Standard Library
- Ubiquity
- Powerful interpreter
Answer: 3)Ubiquity
- List of Fresco Play Courses without Hands-On | Fresco Play
- HMTL5 Semantics Elements MCQs Answers | Fresco Play
- HMTL5 Semantics Elements Hands-On Solutions | Fresco Play
- Styling with CSS3 Hands-On Solutions | Fresco Play
- Blockchain Intermedio MCQs Answers | Fresco Play
- Blockchain - Potentes Nexus MCQs Answers | Fresco Play
- Azure Essentials MCQs Answers | Fresco Play
- AWS Essentials MCQs Answers | Fresco Play
1.When using the Python shell and code block, what triggers the interpreter to begin evaluating a block of code?
- Blank line
- Execute command
- Semi colon symbol
- Closed parenthesis
- Colon symbol
Answer: 1)Blank line
2.While using Python IDLE, by how many spaces are the code suites indented?
- 4
- 2
- 5
- 1
- 3
Answer: 1)4
3.What command is used to output text from both the Python shell and within a Python module?
- print()
- count()
- System.out.println()
- count_print()
- OutputStream()
Answer: 1)print()
4.Which action must be avoided to prevent the previously-defined names from getting overwritten?
- Import selective objects
- Using aliases when importing
- Use the wildcard import
- Import selectively with aliases
Answer: 3)Use the wildcard import
1.Which statement accurately defines the bool class?
- Zero values are considered True always
- Zero values are considered True some times
- Bool class is a subclass of array class
- Boolean Not returns False if the operand is True
- Boolean first returns False then the True value
Answer: 4)Boolean Not returns False if the operand is True
2.What is the output of bool(0)?
- False
- Valid
- 1
- 0
- True
Answer: 1)False
3.Which statement correctly assigns X as an infinite number?
- x=float('inf')
- X=pos_infinity()
- x=infinity
- x=int('inf')
Answer: 1)x=float('inf')
4.Is x, y = 5, 6 a valid statement?
- True
- False
Answer: 1)True
5.The bool class is a subset of ______.
- long
- char
- int
- float
- string
Answer: 3)int
6.While using 'bool', all zero values are considered as false and non- zero values are considered as true. Is the statement true or false?
- True
- False
Answer: 1)True
7.Equivalent operation for function pow(x, y) is __________.
- x ** y
- x ^ y
- x * y
- x // y
Answer: 1)x ** y
8.Which of the following will not yield in declaring x as the datatype of float?
- x=float(10)
- x=int(y)
- x=5
- x=float.fromhex('A')
Answer: 3)x=5
9.Which datatype is represented by int in Python 3?
- Long
- Short
- float
- Decimal
Answer: 1)Long
1.Values in bytearray should be integers between ___________.
- 0-1024
- 0-255
- 0-63
- 0-512
Answer: 2)0-255
2.Which statements prevent the escape sequence interpretation?
- escape'col\tcol2\tcol3\t'
- subtext'col\tcol2\tcol3\t'
- r'col\tcol2\tcol3\t'
- col1\tcol2\tcol3\t
Answer: 3)r'col\tcol2\tcol3\t'
3.Which methods can be used with list objects?
- Lambda , Pop , Clear
- Decode , Pop , Clear
- Reverse , Pop , Clear
- Reverse , Decode, Lambda
- Reverse , Decode
Answer: 3)Reverse , Pop , Clear
4._______ class provides an immutable sequence of elements.
- string
- tuple
- bytearray
- byte
- list
Answer: 2)tuple
5.While using slicing in lists, list[0:2] is equivalent to ______.
- list[:-2]
- list[-2:0]
- list[:2]
- list[0:3] -1
Answer: 3)list[:2]
6.Which of the following options could be used in the tuple object?
- Reverse, Max
- Sorted, Lens, Max
- Append
Answer: 1)Reverse, Max
7.Using Pop in the list will remove the popped up item.
- True
- False
Answer: 1)True
8.Which statements will result in slice of tuple?
- a_tuple[:] a_tuple[::-1]
- a_tuple[0] =[5] a_tuple[::2]
- a_tuple[::-1] a_tuple[0] =[5]
- a_tuple[::2] a_tuple[:]
Answer: 4)a_tuple[::2] a_tuple[:]
9.What is the output of min('Infinity')?
- f
- y
- 0
- I
Answer: 4)I
10.What is the output of max('Infinity')?
- 0
- I
- 8
- y
- f
Answer: 4)y
11.Which describes bytearrays?
- Without an argument, an array of size 0 is created; contains a sequence of integers 0-255
- Bytearrays are immutable objects
Answer: 1)Without an argument, an array of size 0 is created; contains a sequence of integers 0-255
12.Which statement creates the bytes literal when run?
- bytes_literal = bytes.str.count(0x54)
- bytes_literal = bytes.encoded.count(0x54)
- bytes_literal = b'Copyright \xc2\xa9'
- bytes_literal = bytes(str_literal,'utf-8')
Answer: 3)bytes_literal = b'Copyright \xc2\xa9'
13.What will be the output of the print('*' * 10)?
- 10*
- **10
- *10
- **********
- **********10
Answer: 4)**********
14.An empty list could be created with the list() alone.
- True
- False
Answer: 4)**********
15.bytearray provides a mutable sequence, making it modifiable.
- False
- True
Answer: 2)True
16.Byte datatype can contain only ______ and ______.
- ascii & unicode
- ascii & hexadecimal characters
- unicode alone
- decimal & hexadecimal
Answer: 2)ascii & hexadecimal characters
1.If b is a frozen set, what happens to b.add(3)?
- Error as frozen sets cannot be modified
- 3 will be added as a constant
- 3 will not be available for other general operations
Answer: 1)Error as frozen sets cannot be modified
2.Dictionary could be copied to another dictionary using which of following syntax?
- dict_a = dict_b.clear()
- dict_a = copy(dict_b)
- dict_a=dict_b.copy()
- dict_a = dict_b
Answer: 3)dict_a=dict_b.copy()
3.All of these range types are correct except ______.
- range(20,40,-2)
- range(20,20,2)
- range(20,40,'-2')
- range(20,20,30)
Answer: 3)range(20,40,'-2')
4.Empty dictionary is represented as ________.
- ({})
- {}
- ()
- []
Answer: 2){}
5.a.difference(b) highlights the ________.
- a.union(b) - a.intersection(b)
- a.union(b) - b.intersection(b)
- a.intersection(b) - a.union(b)
- a - b
Answer: 4)a - b
6.a.symmetric_difference(b) highlights the ________.
- a - b
- a.union(b) - b.intersection(b)
- a.union(b) - a.intersection(b)
- a.intersection(b) - a.union(b)
Answer: 3)a.union(b) - a.intersection(b)
Quiz on Loops & Conditionals in Python
1.What is the output of the following code?
count = 0
while count < 2:
print (count, " is less than 2")
count = count + 2
else:
print (count, " is not less than 2")
- 1 is less than 2; 3 is not less than 2
- 2 is not less than 2
- Error
- 0 is less than 2; 2 is not less than 2
Answer: 4)0 is less than 2; 2 is not less than 2
2.What is the output of the following code?
for x in range(1,100, 10):
print(x)
- 2 20 200
- Error
- 2-20-200
- 1 11 21 31 41 51 61 71 81 91
Answer: 4)1 11 21 31 41 51 61 71 81 91
3.What is the output of the following code?
a = 0
if a:
print(""""a's value"""")
else:
print(""""Sorry nothing will get printed"""")
- 0
- a's value
- Sorry nothing will get printed
- Error
Answer: 4)Error
4.What is the output of the following code snippet?
for char in 'Welcome':
print (char, end='*')
print()
- Welcome*
- Error
- Welcome*******
- W*e*l*c*o*m*e*
Answer: 4)W*e*l*c*o*m*e*
1.All of these range types are correct except ___.
- range(20,40,-1.2)
- range(10,20,30)
- range(10,20,2)
Answer: 1)range(20,40,-1.2)
2.Which is the fastest implementation of Python?
- Cpython
- Pypy
- Jython
- Iron Python
Answer: 2)Pypy
3.What is the output of the given code?
list_pt = list('Welcome')
print(list_pt)
- ['W', 'e', 'l', 'c', 'o', 'm', 'e']
- Welcome
- ['Welcome']
- ['W', 'e', 'l', 'c', 'o', 'm', 'e']\n
- ['Welcome']\n
Answer: 1)['W', 'e', 'l', 'c', 'o', 'm', 'e']
4.What is the output of bool(5)?
- False
- True
- 1
- 0
- Valid
Answer: 2)True
5.What characteristics describe the python programming language ?
- Interpreted and open source
- Interpreted and compiled
- Assembly compiled
Answer: 1)Interpreted and open source
6.What is the output of the following code?
a = 0
if a:
print("a's value")
else:
print("Sorry nothing will get printed")
- 0
- a's value
- Sorry nothing will get printed
- Error
Answer: 3)Sorry nothing will get printed
- List of Fresco Play Courses without Hands-On | Fresco Play
- HMTL5 Semantics Elements MCQs Answers | Fresco Play
- HMTL5 Semantics Elements Hands-On Solutions | Fresco Play
- Styling with CSS3 Hands-On Solutions | Fresco Play
- Blockchain Intermedio MCQs Answers | Fresco Play
- Blockchain - Potentes Nexus MCQs Answers | Fresco Play
- Azure Essentials MCQs Answers | Fresco Play
- AWS Essentials MCQs Answers | Fresco Play
Post a Comment
Any comments and suggestion will be appreciated.