DON'T WANT TO MISS A THING?

Certification Exam Passing Tips

Latest exam news and discount info

Curated and up-to-date by our experts

Yes, send me the newsletter

Free Python PCAP Test Practice Online | SPOTO

SPOTO's latest exam dumps on the homepage, with a 100% pass rate! SPOTO delivers authentic Cisco CCNA, CCNP study materials, CCIE Lab solutions, PMP, CISA, CISM, AWS, and Palo Alto exam dumps. Our comprehensive study materials are meticulously aligned with the latest exam objectives. With a proven track record, we have enabled thousands of candidates worldwide to pass their IT certifications on their first attempt. Over the past 20+ years, SPOTO has successfully placed numerous IT professionals in Fortune 500 companies.

Take other online exams

Question #1
Which of the following expressions evaluate to True? (Select two answers)
A. 121 + 1 != '!'+ 2 * '2'correct
B. 'AbC' lower () 'AB'<
C. '1'+ '1'+ '1'< '1'*3'
D. '3
View answer
Correct Answer: AD
Question #2
What is the expected output of the following snippet?
A. 1
B. 4
C. 2correct
D. 3
View answer
Correct Answer: C
Question #3
Which of the following lines of code will work flawlessly when put independently inside theadd_new () method in order to make the snippet's output equal to [0, 1, 1]? (Select two answers)
A. put self
B. self put stire(1])correct
C. self
D. self
View answer
Correct Answer: ABD
Question #4
A file name like this one below says mat: (select three answers) services. cpython-36.pyc
A. the interpreter used to generate the file is version 3
B. it has been produced by CPythoncorrect
C. it is the 36th version of the file
D. the file comes from the services
View answer
Correct Answer: ABD
Question #5
Which of the following invocations are valid? (Select two answers)
A. rfind("python","r")
B. sorted("python")correct
C. "python"
D. "python"
View answer
Correct Answer: BD
Question #6
What is the expected output of the following code if the file named existing_text_file is a non-zero length text file located inside the working directory?
A. the length of the first line from the file
B. -1correct
C. the number of lines contained inside the file
D. the length of the last line from the file
View answer
Correct Answer: B
Question #7
What is the output of the following piece of code?
A. ant’ bat’ camelcorrect
B. ant”bat” camelcorrect
C. antbatcamel
D. print (a, b, c, sep= ‘ ” ’)
View answer
Correct Answer: AB
Question #8
The following class hierarchy is given. What is the expected output of the code?
A. BB
B. CC
C. AA
D. BCcorrect
View answer
Correct Answer: D
Question #9
What is the expected out of the following code of the file named zero_length_existing_file is a zero-length file located inside the working directory?
A. 0
B. -1correct
C. an errno value corresponding to file not found
D. 2
View answer
Correct Answer: B
Question #10
What is true about Python packages? (Choose two.)
A. a code designed to initialize a package’s state should be placed inside a file named init
B. a package’s contents can be stored and distributed as an mp3 file
C. __pycache__ is a folder that stores semi-compiled Python modules
D. the sys
View answer
Correct Answer: AC
Question #11
What is the expected output of the following code? import sys import math b1 = type(dir(math)) is list b2 = type(sys.path) is list print(b1 and b2)
A. None
B. True
C. 0
D. False
View answer
Correct Answer: B
Question #12
What is the expected behavior of the following code?
A. it outputs 'None'
B. it outputs 3correct
C. it raises an exception
D. it outputs 0
View answer
Correct Answer: B
Question #13
What is the expected output of the following snippet?
A. abc
B. The code will cause a runtime exceptioncorrect
C. ABC
D. 123
View answer
Correct Answer: B
Question #14
What is true about Object-Oriented Programming in Python? (Select two answers)
A. encapsulation allows you to protect some data from uncontrolled accesscorrect
B. the arrows on a class diagram are always directed from a superclass towards itssubclass
C. inheritance is the relation between a superclass and a subclasscorrect
D. an object is a recipe for a class
View answer
Correct Answer: AC
Question #15
What is true about Python packages? (Select two answers)
A. the__name__variable content determines the way in which the module was run
B. a package can be stored as a tree of sub-directories/sub-folders
C. __pycache__is the name of a built-in variable
D. hashbang is the name of a built-in Python functioncorrect
View answer
Correct Answer: D
Question #16
Which of the following expression evaluate to True? (Select two answers) A) B) C) D)
A. AOption A
B. BOption B
C. COption C
D. DOption D
View answer
Correct Answer: CD
Question #17
The following class hierarchy is given . What is the expected out of the code?
A. BB
B. CC
C. AA
D. BCcorrect
View answer
Correct Answer: D
Question #18
You are going to read just one character from a stream called s. Which statement would you use?
A. ch = read(s, 1)
B. ch = s
C. ch = input(s, 1)
D. ch = s
View answer
Correct Answer: D
Question #19
Assuming that the following inheritance set is in force, which of the following classes are declared properly? (Select two answers)
A. class Class_4 (D, A) : passcorrect
B. class Class_1(C,D): passcorrect
C. class Class_3(A,C): pass
D. class Class_2(B,D): pass
View answer
Correct Answer: AB
Question #20
What is the expected behavior of the following code?
A. it outputs 'None'
B. it outputs 3
C. it raises an exception
D. it outputs 0correct
View answer
Correct Answer: D
Question #21
If you need to serve two different exceptions called Ex1 and Ex2 in one except branch, you can write:
A. except Ex1 Ex2:
B. except (ex1, Ex2):
C. except Ex1, Ex2:
D. except Ex1+Ex2:correct
View answer
Correct Answer: D
Question #22
What can you do if you don’t like a long package path like this one?
A. you can make an alias for the name using the alias keyword
B. nothing, you need to come to terms with it
C. you can shorten it to alpha
D. you can make an alias for the name using the as keywordcorrect
View answer
Correct Answer: D
Question #23
The following class hierarchy is given. What is the expected out of the code?
A. BB
B. CC
C. AA
D. BCcorrect
View answer
Correct Answer: D
Question #24
With regards to the directory structure below, select the proper forms of the directives in order to import module_ a. (Select two answers)
A. import pypack
B. import module_a from pypack
C. import module_a
D. from pypack import module_a
View answer
Correct Answer: AD
Question #25
What is the expected behavior of the following code? It will:
A. print 0
B. cause a runtime exceptioncorrect
C. prints 3
D. print an empty line
View answer
Correct Answer: B
Question #26
A file name like this one below says that: (Select three answers) services, cpython 36.pyc
A. the interpreter used to generate the file is version 3
B. it has been produced by CPythoncorrect
C. it is the 36th version of the file
D. the file comes from the services
View answer
Correct Answer: ABD
Question #27
A Python module named pymod.py contains a variable named pyvar. Which of the following snippets will let you access the variable? (Select two answers)
A. import pyvar from pymod pyvar = 1correct
B. from pymod import pyvar = 1
C. from pymod import pyvar pyvar ()
D. import pymod pymod
View answer
Correct Answer: AD
Question #28
What is the expected behavior of the following code?
A. it outputs 'None'
B. it outputs 3correct
C. it raises an exception
D. it outputs 0
View answer
Correct Answer: B
Question #29
Which one of the platform module functions should be used to determine the underlying platform name?
A. platform
B. platform
C. platform
D. platform
View answer
Correct Answer: B
Question #30
Assuming that the snippet below has been executed successfully, which of the following expressions will evaluate to True? (Select two answers) string = 'SKY' (:: -1) string = string (-1)
A. Astring is None
B. Bstring (0) == string (-1
C. Cstring (0) == 'Y'
D. Dlen (string) == 1
View answer
Correct Answer: CD

View The Updated Python Exam Questions

SPOTO Provides 100% Real Python Exam Questions for You to Pass Your Python Exam!

View Answers after Submission

Please submit your email and WhatsApp to get the answers of questions.

Note: Please make sure your email ID and Whatsapp are valid so that you can get the correct exam results.

Email:
Whatsapp/phone number: