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

Latest Python PCEP Free Exam Questions | 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
What will happen when you attempt to run the following code? print(Hello, World!)
A. The code will raise the SyntaxError exception
B. The code will raise the TypeError exception
C. The code will raise the ValueError exception
D. The code will print Hello, World! to the console
E. The code will raise the AttributeError exception
View answer
Correct Answer: A
Question #2
Which of the following are the names of Python passing argument styles? (Select two answers.)
A. Akeyword
B. Breference
C. Cindicatory
D. Dpositional
View answer
Correct Answer: AD
Question #3
You develop a Python application for your company. You have the following code. def main(a, b, c, d): value = a + b * c - d return value Which of the following expressions is equivalent to the expression in the function?
A. (a + b) * (c - d)
B. a + ((b * c) - d)
C. None of the above
D. (a + (b * c)) - dcorrect
View answer
Correct Answer: D
Question #4
What is the output of the following code? a = 1 b = 0 x = a or b y = not(a and b) print(x + y)
A. The program will cause an error
B. 1
C. The output cannot be predicted
D. 2correct
View answer
Correct Answer: D
Question #5
What is true about exceptions and debugging? (Select two answers.)
A. AA tool that allows you to precisely trace program execution is called a debugger
B. BIf some Python code is executed without errors, this proves that there are no errors in it
C. COne try-except block may contain more than one except branch
D. DThe default (anonymous) except branch cannot be the last branch in the try-except block
View answer
Correct Answer: AC
Question #6
What is the output of the following snippet? def fun(x, y, z): return x + 2 * y + 3 * z print(fun(0, z=1, y=3))
A. the snippet is erroneous
B. 9correct
C. 0
D. 3
View answer
Correct Answer: B
Question #7
Assuming that the tuple is a correctly created tuple, the fact that tuples are immutable means that the following instruction: my_tuple[1] = my_tuple[1] + my_tuple[0]
A. can be executed if and only if the tuple contains at least two elements
B. is illegalcorrect
C. may be illegal if the tuple contains strings
D. is fully correct
View answer
Correct Answer: B
Question #8
Which of the following expressions evaluate to a non - zero result? (Select two answers.)
A. 2 ** 3 / A - 2
B. 4 / 2 * * 3 - 2
C. 1 * * 3 / 4 - 1
D. 1 * 4 // 2 ** 3
View answer
Correct Answer: AB
Question #9
What is the output of the following code? a = 1 b = 0 x = a or b y = not(a and b) print(x + y)
A. The program will cause an error
B. 1
C. The output cannot be predicted
D. 2correct
View answer
Correct Answer: D
Question #10
What will be the output of the following code snippet? d = {} d[1] = 1 d['1'] = 2 d[1] += 1 sum = 0 for k in d: sum += d[k] print(sum)
A. 3
B. 4correct
C. 1
D. 2
View answer
Correct Answer: B
Question #11
Python Is an example of which programming language category?
A. interpretedcorrect
B. assembly
C. compiled
D. machine
View answer
Correct Answer: A
Question #12
Take a look at the snippet, and choose the true statements: (Select two answers) nums = [1, 2, 3] vals = nums del vals[1:2]
A. nums is longer than valscorrect
B. nums and vals refer to the same listcorrect
C. vals is longer than nums
D. nums and vals are of the same lengthcorrect
View answer
Correct Answer: ABD
Question #13
Python name comes from which of the following?
A. Python Café
B. Python Forest
C. Python snake
D. Monty Python’s Flying Circus
View answer
Correct Answer: D
Question #14
What is the expected output of the following code? list1 = [1, 3] list2 = list1 list1[0] = 4 print(list2)
A. [1, 4]
B. [4, 3]correct
C. [1, 3, 4]
D. [1, 3]
View answer
Correct Answer: B
Question #15
Which of the following functions can be invoked with two arguments? A) B) C) D)
A. AOption A
B. BOption B
C. COption C
D. DOption D
View answer
Correct Answer: B
Question #16
What is the expected output of the following code? def func(data): for d in data[::2]: yield d for x in func('abcdef'): print(x, end='')
A. bdf
B. An empty line
C. abcdef
D. acecorrect
View answer
Correct Answer: D
Question #17
Insert the correct snippet so that the program produces the expected output. Expected output: Code:
A. b = 0 not in list
B. b = list[0]
C. b = 0 in list
D. b = False
View answer
Correct Answer: C
Question #18
Who created Python?
A. Guido ban Rossum
B. Guido van Rossum
C. Guido the Russian
D. Guodo van Rossum
View answer
Correct Answer: B
Question #19
What is the expected output of the following code? x = True y = False z = False if not x or y: print(1) elif not x or not y and z: print(2) elif not x or y or not y and x: print(3) else: print(4)
A. 4
B. 3correct
C. 2
D. 1
View answer
Correct Answer: B
Question #20
What will be the output of the following code snippet? print(3 / 5)
A. 6/10
B. 0
C. 0
D. None of the above
View answer
Correct Answer: B
Question #21
The result of the following addition: 123 + 0.0
A. cannot be evaluated
B. is equal to 123
C. is equal to 123
View answer
Correct Answer: B
Question #22
Which of the following variable names are illegal? (Select two answers)
A. TRUEcorrect
B. Truecorrect
C. true
D. andcorrect
View answer
Correct Answer: ABD
Question #23
Take a look at the snippet, and choose the true statements: (Select two answers) nums = [1, 2, 3] vals = nums del vals[1:2]
A. nums is longer than valscorrect
B. nums and vals refer to the same listcorrect
C. vals is longer than nums
D. nums and vals are of the same lengthcorrect
View answer
Correct Answer: ABD
Question #24
Assuming that the tuple is a correctly created tuple, the fact that tuples are immutable means that the following instruction:
A. is illegal
B. may be illegal if the tuple contains strings
C. can be executed if and only if the tuple contains at least two elements
D. is fully correct
View answer
Correct Answer: A
Question #25
A function definition starts with the keyword:
A. defcorrect
B. function
C. fun
View answer
Correct Answer: A
Question #26
What is the expected output of the following code?
A. AThe code outputs nothing
B. B3
C. C1
D. D4
View answer
Correct Answer: C
Question #27
What are the four fundamental elements that make a language?
A. An alphabet, phonetics, phonology, and semantics
B. An alphabet, a lexis, phonetics, and semantics
C. An alphabet, morphology, phonetics, and semantics
D. An alphabet, a lexis, a syntax, and semanticscorrect
View answer
Correct Answer: D
Question #28
You develop a Python application for your company. You have the following code. def main(a, b, c, d): value = a + b * c - d return value Which of the following expressions is equivalent to the expression in the function?
A. (a + b) * (c - d)
B. a + ((b * c) - d)
C. None of the above
D. (a + (b * c)) - dcorrect
View answer
Correct Answer: D
Question #29
What is the output of the following snippet? def fun(x, y, z): return x + 2 * y + 3 * z print(fun(0, z=1, y=3))
A. the snippet is erroneous
B. 9correct
C. 0
D. 3
View answer
Correct Answer: B
Question #30
The digraph written as #! is used to:
A. tell a Unix or Unix-like OS how to execute the contents of a Python file
B. create a docstring
C. make a particular module entity a private one
D. tell an MS Windows OS how to execute the contents of a Python file
View answer
Correct Answer: A

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: