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

Python PCEP Exam Questions and Answers, Certified Associate Python Programmer | 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 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 #2
How many stars will the following snippet print to the monitor? i = 4 while i > 0: i -= 2 print('*') if i == 2: break else: print('*') The snippet will enter an infinite loop.
A. 0
B. 2
C. 1correct
View answer
Correct Answer: C
Question #3
What is the expected output of the following code?
A. [1, 3]
B. [1, 4]
C. [4, 3]
D. [1, 3, 4]
View answer
Correct Answer: C
Question #4
Which of the following for loops would output the below number pattern? 11111 22222 33333 44444 55555
A. for i in range(0, 5):print(str(i) * 5)
B. for i in range(1, 6):print(str(i) * 5)correct
C. for i in range(1, 6):print(i, i, i, i, i)
D. for i in range(1, 5):print(str(i) * 5)
View answer
Correct Answer: B
Question #5
What is the expected output of the following code? z = y = x = 1 print(x, y, z, sep='*')
A. x*y*z
B. 111*
C. x y z
D. 1*1*1correct
E. 1 1 1
F. The code is erroneous
View answer
Correct Answer: D
Question #6
What is the expected output of the following code? num = 1 def func(): num = num + 3 print(num) func() print(num)
A. 4 1
B. 4 4
C. The code is erroneous
D. 1 4
E. 1 1
View answer
Correct Answer: C
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
What is the expected output of the following code? num = 1 def func(): num = num + 3 print(num) func() print(num)
A. 4 1
B. 4 4
C. The code is erroneous
D. 1 4
E. 1 1
View answer
Correct Answer: C
Question #9
What is the expected result of the following code?
A. The code is erroneous and cannot be run
B. 20
C. 10
D. 30
View answer
Correct Answer: A
Question #10
What is CPython?
A. It' a programming language that is a superset of the C language,
B. designed to produce Python-like performance with code written in C
C. It' a programming language that is a superset of the Python,
D. designed to produce C-like performance with code written in Python
E. It's a default, reference implementation of the C language, written in Python
F. It's a default, reference implementation of the Python language, written in Ccorrect
View answer
Correct Answer: F
Question #11
What is the expected output of the following code?
A. 2
B. 4
C. 5
D. 3
View answer
Correct Answer: B
Question #12
Which of the following are the names of Python passing argument styles? (Select two answers.)
A. keyword
B. reference
C. indicatory
D. positional
View answer
Correct Answer: AD
Question #13
What is the expected output of the following code? z = y = x = 1 print(x, y, z, sep='*')
A. x*y*z
B. 111*
C. x y z
D. 1*1*1correct
E. 1 1 1
F. The code is erroneous
View answer
Correct Answer: D
Question #14
What is the expected output of the following code? x = ''' print(len(x))
A. 1correct
B. 2
C. The code is erroneous
D. 0
View answer
Correct Answer: A
Question #15
What will be the output of the following code snippet? x = 1 y = 2 z = x x = y y = z print (x, y)
A. 1 2
B. 2 1correct
C. 1 1
D. 2 2
View answer
Correct Answer: B
Question #16
Which of the following are correct statements?
A. True + 1 evaluates to 2
B. True and False evaluates to False
C. True or False evaluates to False
D. 7+ False evaluates to False
View answer
Correct Answer: AB
Question #17
The ABC organics company needs a simple program that their call center will use to enter survey data for a new coffee variety. The program must accept input and return the average rating based on a five-star scale. The output must be rounded to two decimal places. You need to complete the code to meet the requirements. sum = count = done = 0 average = 0.0 while done != -1: rating = XXX if rating == -1: break sum += rating count += 1 average = float(sum / count) YYY + ZZZ What should you insert instead of XX
A. XXX -> float(input('Enter next rating (1-5), -1 for done'))YYY -> print('The average star rating for the new coffee is: 'ZZZ -> format(average, '
B. XXX -> float(input('Enter next rating (1-5), -1 for done'))YYY -> printline('The average star rating for the new coffee is: 'ZZZ -> format(average, '
C. XXX -> print(input('Enter next rating (1-5), -1 for done'))YYY -> print('The average star rating for the new coffee is: 'ZZZ -> format(average, '
D. XXX -> float(input('Enter next rating (1-5), -1 for done'))YYY -> output('The average star rating for the new coffee is: 'ZZZ -> format(average, '
E. XXX -> float(input('Enter next rating (1-5), -1 for done'))YYY -> print('The average star rating for the new coffee is: 'ZZZ -> format(average, '
F. XXX -> input('Enter next rating (1-5), -1 for done')YYY -> print('The average star rating for the new coffee is: 'ZZZ -> format(average, '
View answer
Correct Answer: E
Question #18
Which of the following is incorrect for a dictionary in Python?
A. each key must be unique
B. the key should be an immutable object
C. the len() function returns the sum of key-value elements in the dictionary
D. the len() function returns the numbers of key-value elements in the dictionary
View answer
Correct Answer: C
Question #19
What is the expected output of the following code?
A. 2
B. 0
C. 3
D. 1
View answer
Correct Answer: D
Question #20
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 #21
What is the expected output of the following code?
A. ['Peter', 404, 3
B. None of the above
C. [404, 3
D. ['Peter', 'Wellert']
View answer
Correct Answer: C
Question #22
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
Question #23
What is the default return value for a function that does not explicitly return any value?
A. int
B. void
C. Nonecorrect
D. Null
E. public
View answer
Correct Answer: C
Question #24
What is the expected behavior of the following program? try: print(5/0) break except: print("Sorry, something went wrong...") except (ValueError, ZeroDivisionError): print("Too bad...")
A. The program will cause a SyntaxError exception
B. The program will cause a ValueError exception and output the following message: Too bad
C. The program will cause a ValueError exception and output a default error message
D. The program will raise an exception handled by the first except block
E. The program will cause a ZeroDivisionError exception and output a default error message
View answer
Correct Answer: A
Question #25
What is the expected output of the following code? def func(x): return 1 if x % 2 != 0 else 2 print(func(func(1)))
A. The code is erroneous
B. None
C. 2
D. 1correct
View answer
Correct Answer: D
Question #26
Which of the following functions can be invoked with two arguments? A) B) C) D)
A. Option A
B. Option B
C. Option C
D. Option D
View answer
Correct Answer: B
Question #27
What is true about exceptions and debugging? (Select two answers.)
A. A tool that allows you to precisely trace program execution is called a debugger
B. If some Python code is executed without errors, this proves that there are no errors in it
C. One try-except block may contain more than one except branch
D. The default (anonymous) except branch cannot be the last branch in the try-except block
View answer
Correct Answer: AC
Question #28
How many stars will the following snippet print to the monitor? i = 4 while i > 0: i -= 2 print('*') if i == 2: break else: print('*') The snippet will enter an infinite loop.
A. 0
B. 2
C. 1correct
View answer
Correct Answer: C
Question #29
What is the expected output of the following code? x = [[[1, 2], [3, 4]], [[5, 6], [7, 8]]] def func(data): res = data[0][0] for da in data: for d in da: if res < d: res = d return res print(func(x[0]))
A. The code is erroneous
B. 8
C. 6
D. 2
E. 4correct
View answer
Correct Answer: E
Question #30
What would you insert instead of so that the program checks for even numbers? if ???: print('x is an even number')
A. x % x == 0
B. x % 1 == 2
C. x % 2 == 0correct
D. x % 'even' == True
E. x % 2 == 1
View answer
Correct Answer: C

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: