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 Sample 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 does the method items() returns in Python Dictionary?
A. The method items() returns the lists
B. The method items() returns the tuples
C. The method items() returns the keys in a list
D. The method items() returns the values in a list
View answer
Correct Answer: B
Question #2
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 #3
What is the expected result of running the following code?
A. AThe code prints 1
B. BThe code prints 2
C. CThe code raises an unhandled exception
D. DThe code prints 0
View answer
Correct Answer: C
Question #4
Python Is an example of which programming language category?
A. Ainterpreted
B. Bassembly
C. Ccompiled
D. Dmachine
View answer
Correct Answer: A
Question #5
What is the expected output of the following code if the user enters 2 and 4? x = input() y = input() print(x + y)
A. 4
B. 6
C. 24correct
D. 2
View answer
Correct Answer: C
Question #6
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 #7
The value thirty point eleven times ten raised to the power of nine should be written as:
A. 30
B. 30E11
C. 30
D. 30
View answer
Correct Answer: A
Question #8
An integer number preceded by an 0x (Zero-x) will be treated as:
A. Octal
B. Binary
C. Hexadecimal
D. Decimal
View answer
Correct Answer: C
Question #9
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 #10
What is the expected output of the following code? data = ['Peter', 404, 3.03, 'Wellert', 33.3] print(data[1:3])
A. None of the above
B. ['Peter', 404, 3
C. ['Peter', 'Wellert']
D. [404, 3
View answer
Correct Answer: D
Question #11
A set of rules which defines the ways in which words can be coupled in sentences is called:
A. lexis
B. syntaxcorrect
C. semantics
D. dictionary
View answer
Correct Answer: B
Question #12
What will be the output of the following code snippet?
A. [1, 3, 5, 7, 9]
B. [8, 9]
C. [1, 2, 3]
D. [1, 2]
View answer
Correct Answer: A
Question #13
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 #14
Strings in Python are delimited with:
A. backslashes (i
B. double quotes (i
C. asterisks (i
D. dollar symbol (i
View answer
Correct Answer: B
Question #15
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 #16
What is the expected output of the following code? print(list('hello'))
A. None of the above
B. hello
C. [h, e, l, l, o]
D. ['h', 'e', 'l', 'l', 'o']correct
E. ['h' 'e' 'l' 'l' 'o']
View answer
Correct Answer: D
Question #17
The value thirty point eleven times ten raised to the power of nine should be written as:
A. 30
B. 30E11
C. 30
D. 30
View answer
Correct Answer: A
Question #18
What happens when the user runs the following code?
A. The code outputs 3
B. The code outputs 2
C. The code enters an infinite loop
D. The code outputs 1
View answer
Correct Answer: B
Question #19
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 #20
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 #21
Python is an example of:
A. a machine language
B. a high-level programming languagecorrect
C. a natural language
View answer
Correct Answer: B
Question #22
Which of the following lines correctly invoke the function defined below: def fun(a, b, c=0): # Body of the function. (Select two answers)
A. fun(0, 1, 2)correct
B. fun(b=0, a=0)correct
C. fun(b=1)
D. fun()
View answer
Correct Answer: AB
Question #23
What is the expected output of the following code? def func(text, num): while num > 0: print(text) num = num - 1 func('Hello', 3)
A. An infinite loop
B. HelloHelloHello
C. HelloHelloHelloHello
D. HelloHello
View answer
Correct Answer: A
Question #24
What is the expected output of the following code? data = ['Peter', 404, 3.03, 'Wellert', 33.3] print(data[1:3])
A. None of the above
B. ['Peter', 404, 3
C. ['Peter', 'Wellert']
D. [404, 3
View answer
Correct Answer: D
Question #25
A function definition starts with the keyword:
A. defcorrect
B. function
C. fun
View answer
Correct Answer: A
Question #26
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 #27
How many hashes (+) does the code output to the screen?
A. one
B. zero (the code outputs nothing)
C. fivecorrect
D. three
View answer
Correct Answer: C
Question #28
How many stars will the following code print to the monitor? i = 0 while i <= 3: i += 2 print('*')
A. one
B. zero
C. twocorrect
D. three
View answer
Correct Answer: C
Question #29
What is the expected output of the following code? def func(num): res = '*' for _ in range(num): res += res return res for x in func(2): print(x, end='')
A. **
B. The code is erroneous
C. *
D. ****correct
View answer
Correct Answer: D
Question #30
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

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: