Python Certification Exam Preparation Set 21

Given the code fragment:

What is the result?


Options are :

  • MON
  • None (Correct)
  • null
  • An error is raised

Answer :None

Given the code fragment:

What is the result?


Options are :

  • None
  • Upload course contents (Correct)
  • TODO
  • Review the book

Answer :Upload course contents

Python Practice Test MCQ Certified Go from 0 to Expert hero Set 17

Given the code fragment:

What is the result?


Options are :

  • [85, 75, 90, 80]
  • [80, 90, 75, 85] (Correct)
  • [75, 80, 85, 90]
  • [90, 85, 80, 75]
  • [85, 75, 90, 80, 80, 90, 75, 85]
  • [80, 90, 75, 85, 85, 75, 90, 80]

Answer :[80, 90, 75, 85]

Given the code snippet:

Which of the following option can be filled in the blank such that output will be {'a'}?


Options are :

  • ()
  • []
  • {}
  • set() (Correct)

Answer :set()

Given the code fragment:

What is the result?


Options are :

  • [[], 'x']
  • ['x', []]
  • [['x']] (Correct)
  • An error is raised

Answer :[['x']]

Python Certification Exam Preparation Set 29

Given the code fragment:

What is the result?


Options are :

  • An error is raised
  • 1
  • 1 None
  • 1 None None (Correct)

Answer :1 None None

Given the code fragment:

What is the result?


Options are :

  • Python!!! (Correct)
  • !!!nohtyP
  • An error is raised

Answer :Python!!!

Given the code fragment:

What is the result?


Options are :

  • Football
  • 2018
  • Football world cup2018
  • Footballworldcup2018 (Correct)

Answer :Footballworldcup2018

Python Certification Exam Preparation Set 54

1. Is the below statement true regarding the variable name?

Statement: For the default encoding in python 3, A variable name can contain the letters from the English language only.


Options are :

  • Yes
  • No (Correct)

Answer :No

Python Certification Exam Preparation Set 61

2. Choose the correct output of the following code:-


Options are :

  • Error
  • [('abc', 'bca'), 24.56, 23.64, 'bca'] [('abc', 'bca'), 'abc', 23.64, [1, 2, 3]] (Correct)
  • [('abc', 'bca'), 'abc', 23.64, 'bca'] [('abc', 'bca'), 'abc', 23.64, 'bca']

Answer :[('abc', 'bca'), 24.56, 23.64, 'bca'] [('abc', 'bca'), 'abc', 23.64, [1, 2, 3]]

3. Choose the correct output of the following code:-



Options are :

  • 45
  • 0
  • Error (Correct)
  • 36

Answer :Error

4. Choose the correct output of the following code:-


Options are :

  • Python Python Python ...... ...... ...... ......
  • PythonPythonPythonPython...... (Correct)
  • Error
  • Print Nothing

Answer :PythonPythonPythonPython......

Python Practice Test MCQ Certified Go from 0 to Expert hero Set 23

5. The output of the following code is:-


Options are :

  • False True True False False True (Correct)
  • False False False False False False
  • True False False True True False
  • True True True True True True

Answer :False True True False False True

6. Which among the following print statement will print 4?


Options are :

  • print(2<<1) (Correct)
  • print(2^2)
  • print(2**2) (Correct)
  • print(2*2) (Correct)

Answer :print(2<<1) print(2**2) print(2*2)

7. Choose the correct statements.


Options are :

  • The below equation is evaluated from left to right. 2&2+3*3**2
  • The below equation is evaluated from left to right. 3*2/3*3 (Correct)
  • The below equation is evaluated from right to left. 2&2+3*3**2 (Correct)
  • The below equation is evaluated from right to left 3*3/3*3

Answer :The below equation is evaluated from left to right. 3*2/3*3 The below equation is evaluated from right to left. 2&2+3*3**2

Python Certification Exam Preparation Set 20

8. Choose the correct statement for the below code:-


Options are :

  • prints address of Class_A object
  • Error (Correct)
  • 20

Answer :Error

9. Fill in the blank with the correct option, So that the below code will print File not found

Assume that the file sys.txt does not exist in the system.


Options are :

  • OSError (Correct)
  • TypeError
  • ValueError
  • IOError (Correct)

Answer :OSError IOError

10. Assume that the location of the sys.txt file is D:\New.

Which among the following code will print the data present inside the sys.txt file.


Options are :

  • file = open('D:\\New\sys.txt', 'r') for each in file: print (each) (Correct)
  • file = open('D:\New\sys.txt', 'r') for each in file: print (each) file.close()
  • file = open('D:\\New\sys.txt', 'r') for each in file: print (each) file.close() (Correct)
  • file = open('D:\New\sys.txt', 'r') for each in file: print (each)

Answer :file = open('D:\\New\sys.txt', 'r') for each in file: print (each) file = open('D:\\New\sys.txt', 'r') for each in file: print (each) file.close()

Python Certification Exam Preparation Set 13

11. Which among the following function is used to close the file in the python program?


Options are :

  • close() (Correct)
  • closed()
  • end()
  • flush()

Answer :close()

12. Which among the following are the correct ways to represent

0.000000123


Options are :

  • 1.23 * 10 ** -7 (Correct)
  • 1.23E-7 (Correct)
  • 1.23e-7 (Correct)
  • 1.23*10^-7

Answer :1.23 * 10 ** -7 1.23E-7 1.23e-7

13.: Choose the correct output of the following code:-


Options are :

  • 0-1.5-3.0- (Correct)
  • 0-1.5-3.0
  • 0-1.5-3.0-0
  • Error as else can not be used with a while loop.

Answer :0-1.5-3.0-

Python Practice Test MCQ Certified Go from 0 to Expert hero Set 29

14: Choose the correct output of the following code:-


Options are :

  • 27 17 27 22
  • 27 17 34 22 (Correct)
  • 24 24 29 29
  • Error

Answer :27 17 34 22

15. Choose the correct output of the following code:-

print(tuple[3])


Options are :

  • Index Error
  • Type Error (Correct)
  • Name Error
  • Value Error

Answer :Type Error

16. Choose the correct output of the following code:-


Options are :

  • Sum inside Sum() : 70 Sum outside Sum() : 70
  • Sum inside Sum() : 50 Sum outside Sum() : 70
  • Sum inside Sum() : 50 Sum outside Sum() : 50
  • Error (Correct)

Answer :Error

Python Certification Exam Preparation Set 57

17. If the sys.txt file contains the 3 lines,

1st line (Welcome),

2nd line (To Python),

3rd line (Programming)

What will be the output of the following code:-   


Options are :

  • Welcome To Python Programming (Correct)
  • Welco
  • Welcome
  • Error

Answer :Welcome To Python Programming

18. Choose the correct output of the following code:-


Options are :

  • a, c and b a, b and c (Correct)
  • , aa and a a, a and a
  • a, b and c a, b and c
  • a, c and b , and

Answer :a, c and b a, b and c

19. Will the below code will raise an error or not.


Options are :

  • Yes
  • No (Correct)

Answer :No

Python Practice Test MCQ Certified Go from 0 to Expert hero Set 31

20. Choose the correct output of the following code:-

print(1**2**2.)


Options are :

  • 2
  • 2.0
  • 1.0 (Correct)
  • 1

Answer :1.0

21. The output of the following code is:-


Options are :

  • 31 00031 (Correct)
  • 26 00026
  • 25 00025
  • 25 25

Answer :31 00031

22. Choose the correct output of the following code:-

print("% 10E"% (85792229130))


Options are :

  • 8.5792229130E+10
  • 8.579223E+10 (Correct)
  • 8.579223E+09
  • 8.579222913E+10

Answer :8.579223E+10

Python Certification Exam Preparation Set 28

Comment / Suggestion Section
Point our Mistakes and Post Your Suggestions