Python Certification Exam Preparation Set 33

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


Options are :

  • [5] [8] ['A', 'B', 'C', 10] [2]
  • [5] [5, 8] ['A', 'B', 'C', 10] [5, 8, 2] (Correct)
  • [5] [5, 8] [5, 8, 'A', 'B', 'C', 10] [5, 8, 'A', 'B', 'C', 10, 2]
  • Error

Answer :[5] [5, 8] ['A', 'B', 'C', 10] [5, 8, 2]

4. Which among the following is the correct way to open the file sys.txt for the read-only purpose?


Options are :

  • open('sys.txt','r') (Correct)
  • open('sys.txt','w')
  • open('sys.txt','a')
  • open('sys.txt','readOnly')

Answer :open('sys.txt','r')

Python Certification Exam Preparation Set 57

5. Fill in the blank, So that the below code will print  Failed .


Options are :

  • pass (Correct)
  • def __init__(self,status): pass (Correct)
  • def __init__(self,status): super().__init__(status) (Correct)
  • def __init__(self,status): print("Failed ")

Answer :pass def __init__(self,status): pass def __init__(self,status): super().__init__(status)

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


Options are :

  • CarisinDanger
  • ('Car', 'is', 'in', 'Danger') (Correct)
  • An error is raised as there is no constructor in the Car class and the arguments were passed to the Car class constructor while creating the object of the class.
  • The code will work fine and does not print anything.

Answer :('Car', 'is', 'in', 'Danger')

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


Options are :

  • ['0', 0, '1', 1, '2', 2] (Correct)
  • ['0', '1', '2']
  • [0, 1, 2]
  • [0, '0', 1, '1', 2, '2']

Answer :['0', 0, '1', 1, '2', 2]

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

8. Fill in the blank, So that the below code will print Hi i am in except.


Options are :

  • raise Exception (Correct)
  • raise (Correct)
  • raise Exception() (Correct)
  • raise "Python" (Correct)
  • raise =

Answer :raise Exception raise raise Exception() raise "Python"

9. Which among the following statements regarding a text and binary files are correct:-


Options are :

  • Files in which the content written using specific software(for example word for sys.docx file) is visible as it is when they are opened in a text editor like(Notepad++) are called as text files. (Correct)
  • Files in which the content written using specific software(for example word for sys.docx file) is not visible as it is when they are opened in a text editor like(Notepad++) are called as binary files. (Correct)
  • In a binary file, the data is stored as a series of bits (binary values of 1s and 0s). (Correct)
  • In a Text file, the data is stored as a sequence of characters.

Answer :Files in which the content written using specific software(for example word for sys.docx file) is visible as it is when they are opened in a text editor like(Notepad++) are called as text files. Files in which the content written using specific software(for example word for sys.docx file) is not visible as it is when they are opened in a text editor like(Notepad++) are called as binary files. In a binary file, the data is stored as a series of bits (binary values of 1s and 0s).

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


Options are :

  • Python
  • Python Java Java Java Java Java (Correct)
  • Python Java Java Java Java Java . . .
  • Error

Answer :Python Java Java Java Java Java

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

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


Options are :

  • The reference of the price function was printed as the output.
  • Error
  • 2000 (Correct)
  • The reference of the finalPrice function was printed as the output.

Answer :2000

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


Options are :

  • Withdrawal limit exceded Amount left in your account: 300 Oops! Your Withdrawal limit exceeded
  • Amount left in your account: 300 Oops! Your Withdrawal limit exceeded (Correct)
  • Withdrawal limit exceded
  • Amount left in your account: 300 Oops! Your Withdrawal limit exceeded Withdrawal limit exceded

Answer :Amount left in your account: 300 Oops! Your Withdrawal limit exceeded

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


Options are :

  • P y t h o n C e r t i f i c a t i o n
  • Python Certification
  • n o i t a c i f i t r e C n o h t y P
  • noitacifitreC nohtyP (Correct)

Answer :noitacifitreC nohtyP

Python Certification Exam Preparation Set 47

14. Choose which among the following are text files.


Options are :

  • sys.txt (Correct)
  • sys.docx
  • sys.csv (Correct)
  • sys.xlsx
  • sys.py (Correct)
  • sys.pdf

Answer :sys.txt sys.csv sys.py

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


Options are :

  • (Correct)
  • None
  • Error

Answer :

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


Options are :

  • A B C
  • A C (Correct)
  • B C
  • Error

Answer :A C

Python Certification Exam Preparation Set 41

17. Which among the following character sets have a variable-length encoding?


Options are :

  • ASCII
  • UNICODE(UTF - 8) (Correct)
  • UNICODE(UTF - 16) (Correct)
  • UNICODE(UTF - 32)

Answer :UNICODE(UTF - 8) UNICODE(UTF - 16)

18. Which among the following encoding is backward compatible with ASCII Character set encoding?


Options are :

  • UTF - 8 (Correct)
  • UTF - 16
  • UTF - 32

Answer :UTF - 8

19. Which among the following are not a character set?


Options are :

  • UTF-8 (Correct)
  • UTF-16 (Correct)
  • UTF-32 (Correct)
  • UNICODE
  • ASCII

Answer :UTF-8 UTF-16 UTF-32

Python Certification Exam Preparation Set 50

20. Which among the following encoding leads to more memory consumption.


Options are :

  • ASCII Character Set encoding.
  • UTF - 8
  • UTF - 16
  • UTF - 32 (Correct)

Answer :UTF - 32

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


Options are :

  • 20 60
  • 40 30
  • 40 60 (Correct)
  • 20 30

Answer :40 60

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


Options are :

  • 0 0
  • 10 20
  • 80 90
  • 20 50 (Correct)

Answer :20 50

Python Certification Exam Preparation Set 31

23. Fill in the blank, So that the below code will print  1 2 3 :-


Options are :

  • type(i) != NoneType
  • type(i) != None
  • type(i)() != None (Correct)
  • type(i) != ""

Answer :type(i)() != None

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


Options are :

  • 6
  • 0 (Correct)
  • 7
  • 8

Answer :0

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


Options are :

  • 100
  • 200 (Correct)
  • None
  • Error

Answer :200

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

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


Options are :

  • [0, 1, 2, 3, 4]
  • [5, 6, 7, 8, 9] (Correct)
  • [0, 1, 2, 3, 4] [5, 6, 7, 8, 9]
  • Error

Answer :[5, 6, 7, 8, 9]

27. Choose the correct statement from the following.


Options are :

  • UTF stands for Unicode Transformation Format. (Correct)
  • UTF stands for Unicode Text Format.
  • ASCII stands for American Standard Code for Information Interchange. (Correct)

Answer :UTF stands for Unicode Transformation Format. ASCII stands for American Standard Code for Information Interchange.

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


Options are :

  • [1, 2, 3, 4, 1, 2, 3, 4]
  • [2, 4, 6, 8]
  • map object address (Correct)
  • 2 4 6 8

Answer :map object address

Python Certification Exam Preparation Set 12

29. Choose the correct output of the following code.


Options are :

  • AUDI: 320 | BMW: 150 | HONDA: 100 | AUDI: 320 : BMW: 150 : HONDA: 100 :
  • AUDI: 320 | BMW: 150 | HONDA: 100 AUDI: 320 : BMW: 150 : HONDA: 100
  • AUDI: | BMW: | HONDA: | 320 | 150 | 100 | AUDI: : BMW: : HONDA: : 320 : 150 : 100 :
  • AUDI: 320 | BMW: 150 | HONDA: 100 | (Correct)

Answer :AUDI: 320 | BMW: 150 | HONDA: 100 |

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


Options are :

  • [range(0, 5)] [0, 1, 2, 3, 4] (Correct)
  • [0, 1, 2, 3, 4] [0, 1, 2, 3, 4]
  • [range(0, 5)] [range(0, 5)]

Answer :[range(0, 5)] [0, 1, 2, 3, 4]

31. Fill in the blank, So that the below code does not raise an error.


Options are :

  • pass (Correct)
  • var
  • None (Correct)
  • True (Correct)
  • return None
  • leave the blank empty

Answer :pass None True

Python Certification Exam Preparation Set 65

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


Options are :

  • 100
  • 250
  • None
  • Error (Correct)

Answer :Error

Comment / Suggestion Section
Point our Mistakes and Post Your Suggestions