Sorry For Inconvenience, Site is Under Maintenance. Please Goto HomePage

Python 3 Programming FP MCQs Answers

Python 3 Programming FP MCQs Answers
Notes Bureau
Python 3 Programming FP MCQs Answers

Disclaimer: The main motive to provide this solution is to help and support those who are unable to do these courses due to facing some issue and having a little bit lack of knowledge. All of the material and information contained on this website is for knowledge and education purposes only.

Try to understand these solutions and solve your Hands-On problems. (Not encourage copy and paste these solutions)
Python 3 Programming FP MCQs Answers

Course Path: Data Science/DATA SCIENCE BASICS/Python 3 Programming

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.


Quiz on Basics

1.Code written in Python 3 is backward compatible with Python 2.

  1. True
  2. False

Answer: 2)False

2.The following options are the salient features of Python except ___________.

  1. Limited platform support
  2. Open source
  3. Broad standard library
  4. Simple to learn and understand

Answer: 1)Limited platform support

3.Python is ubiquitous. Is this true or false?

  1. False
  2. True

Answer: 2)True

4.The two main versions of Python include ___________.

  1. Python 3.x and 4.x
  2. Python 3.x and 6.x
  3. Python 2.x and 3.x
  4. Python 3.x and 5.x

Answer: 3)Python 2.x and 3.x

5.Python supports automatic garbage collection.

  1. False
  2. True

Answer: 2)True

6.Which of the following attributes exhibits Python's characteristics?

  1. Object-oriented
  2. Broad Standard Library
  3. Ubiquity
  4. Powerful interpreter

Answer: 3)Ubiquity

Quiz on Basic Programming

1.When using the Python shell and code block, what triggers the interpreter to begin evaluating a block of code?

  1. Blank line
  2. Execute command
  3. Semi colon symbol
  4. Closed parenthesis
  5. Colon symbol

Answer: 1)Blank line

2.While using Python IDLE, by how many spaces are the code suites indented?

  1. 4
  2. 2
  3. 5
  4. 1
  5. 3

Answer: 1)4

3.What command is used to output text from both the Python shell and within a Python module?

  1. print()
  2. count()
  3. System.out.println()
  4. count_print()
  5. OutputStream()

Answer: 1)print()

4.Which action must be avoided to prevent the previously-defined names from getting overwritten?

  1. Import selective objects
  2. Using aliases when importing
  3. Use the wildcard import
  4. Import selectively with aliases

Answer: 3)Use the wildcard import


Quiz on Data types in Python

1.Which statement accurately defines the bool class?

  1. Zero values are considered True always
  2. Zero values are considered True some times
  3. Bool class is a subclass of array class
  4. Boolean Not returns False if the operand is True
  5. 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)?

  1. False
  2. Valid
  3. 1
  4. 0
  5. True

Answer: 1)False

3.Which statement correctly assigns X as an infinite number?

  1. x=float('inf')
  2. X=pos_infinity()
  3. x=infinity
  4. x=int('inf')

Answer: 1)x=float('inf')

4.Is x, y = 5, 6 a valid statement?

  1. True
  2. False

Answer: 1)True

5.The bool class is a subset of ______.

  1. long
  2. char
  3. int
  4. float
  5. 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?

  1. True
  2. False

Answer: 1)True

7.Equivalent operation for function pow(x, y) is __________.

  1. x ** y
  2. x ^ y
  3. x * y
  4. x // y

Answer: 1)x ** y

8.Which of the following will not yield in declaring x as the datatype of float?

  1. x=float(10)
  2. x=int(y)
  3. x=5
  4. x=float.fromhex('A')

Answer: 3)x=5

9.Which datatype is represented by int in Python 3?

  1. Long
  2. Short
  3. float
  4. Decimal

Answer: 1)Long


Quiz on Sequence types in Python

1.Values in bytearray should be integers between ___________.

  1. 0-1024
  2. 0-255
  3. 0-63
  4. 0-512

Answer: 2)0-255

2.Which statements prevent the escape sequence interpretation?

  1. escape'col\tcol2\tcol3\t'
  2. subtext'col\tcol2\tcol3\t'
  3. r'col\tcol2\tcol3\t'
  4. col1\tcol2\tcol3\t

Answer: 3)r'col\tcol2\tcol3\t'

3.Which methods can be used with list objects?

  1. Lambda , Pop , Clear
  2. Decode , Pop , Clear
  3. Reverse , Pop , Clear
  4. Reverse , Decode, Lambda
  5. Reverse , Decode

Answer: 3)Reverse , Pop , Clear

4._______ class provides an immutable sequence of elements.

  1. string
  2. tuple
  3. bytearray
  4. byte
  5. list

Answer: 2)tuple

5.While using slicing in lists, list[0:2] is equivalent to ______.

  1. list[:-2]
  2. list[-2:0]
  3. list[:2]
  4. list[0:3] -1

Answer: 3)list[:2]

6.Which of the following options could be used in the tuple object?

  1. Reverse, Max
  2. Sorted, Lens, Max
  3. Append

Answer: 1)Reverse, Max

7.Using Pop in the list will remove the popped up item.

  1. True
  2. False

Answer: 1)True

8.Which statements will result in slice of tuple?

  1. a_tuple[:] a_tuple[::-1]
  2. a_tuple[0] =[5] a_tuple[::2]
  3. a_tuple[::-1] a_tuple[0] =[5]
  4. a_tuple[::2] a_tuple[:]

Answer: 4)a_tuple[::2] a_tuple[:]

9.What is the output of min('Infinity')?

  1. f
  2. y
  3. 0
  4. I

Answer: 4)I

10.What is the output of max('Infinity')?

  1. 0
  2. I
  3. 8
  4. y
  5. f

Answer: 4)y

11.Which describes bytearrays?

  1. Without an argument, an array of size 0 is created; contains a sequence of integers 0-255
  2. 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?

  1. bytes_literal = bytes.str.count(0x54)
  2. bytes_literal = bytes.encoded.count(0x54)
  3. bytes_literal = b'Copyright \xc2\xa9'
  4. 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)?

  1. 10*
  2. **10
  3. *10
  4. **********
  5. **********10

Answer: 4)**********

14.An empty list could be created with the list() alone.

  1. True
  2. False

Answer: 4)**********

15.bytearray provides a mutable sequence, making it modifiable.

  1. False
  2. True

Answer: 2)True

16.Byte datatype can contain only ______ and ______.

  1. ascii & unicode
  2. ascii & hexadecimal characters
  3. unicode alone
  4. decimal & hexadecimal

Answer: 2)ascii & hexadecimal characters


Quiz on Collection & Mapping types

1.If b is a frozen set, what happens to b.add(3)?

  1. Error as frozen sets cannot be modified
  2. 3 will be added as a constant
  3. 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?

  1. dict_a = dict_b.clear()
  2. dict_a = copy(dict_b)
  3. dict_a=dict_b.copy()
  4. dict_a = dict_b

Answer: 3)dict_a=dict_b.copy()

3.All of these range types are correct except ______.

  1. range(20,40,-2)
  2. range(20,20,2)
  3. range(20,40,'-2')
  4. range(20,20,30)

Answer: 3)range(20,40,'-2')

4.Empty dictionary is represented as ________.

  1. ({})
  2. {}
  3. ()
  4. []

Answer: 2){}

5.a.difference(b) highlights the ________.

  1. a.union(b) - a.intersection(b)
  2. a.union(b) - b.intersection(b)
  3. a.intersection(b) - a.union(b)
  4. a - b

Answer: 4)a - b

6.a.symmetric_difference(b) highlights the ________.

  1. a - b
  2. a.union(b) - b.intersection(b)
  3. a.union(b) - a.intersection(b)
  4. 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. 1 is less than 2; 3 is not less than 2
  2. 2 is not less than 2
  3. Error
  4. 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)

  1. 2 20 200
  2. Error
  3. 2-20-200
  4. 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"""")

  1. 0
  2. a's value
  3. Sorry nothing will get printed
  4. Error

Answer: 4)Error

4.What is the output of the following code snippet?

for char in 'Welcome':

    print (char, end='*')

print() 

  1. Welcome*
  2. Error
  3. Welcome*******
  4. W*e*l*c*o*m*e*

Answer: 4)W*e*l*c*o*m*e*


Final Assessment - Python 3

1.All of these range types are correct except ___.

  1. range(20,40,-1.2)
  2. range(10,20,30)
  3. range(10,20,2)

Answer: 1)range(20,40,-1.2)

2.Which is the fastest implementation of Python?

  1. Cpython
  2. Pypy
  3. Jython
  4. Iron Python

Answer: 2)Pypy

3.What is the output of the given code?

list_pt = list('Welcome')

print(list_pt)

  1. ['W', 'e', 'l', 'c', 'o', 'm', 'e']
  2. Welcome
  3. ['Welcome']
  4. ['W', 'e', 'l', 'c', 'o', 'm', 'e']\n
  5. ['Welcome']\n

Answer: 1)['W', 'e', 'l', 'c', 'o', 'm', 'e']

4.What is the output of bool(5)?

  1. False
  2. True
  3. 1
  4. 0
  5. Valid

Answer: 2)True

5.What characteristics describe the python programming language ?

  1. Interpreted and open source
  2. Interpreted and compiled
  3. 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")

  1. 0
  2. a's value
  3. Sorry nothing will get printed
  4. Error

Answer: 3)Sorry nothing will get printed


If you want answers to any of the fresco play courses feel free to ask in the comment section, we will surely help.

Post a Comment

Any comments and suggestion will be appreciated.
Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.

Join Telegram Channel

Join Notes Bureau Lets Teach and Learn

Join Telegram Channel
CLOSE ADS
CLOSE ADS