Python Institute PCEP-30-02

Page:    1 / 36   
Total 180 questions | Updated On: Apr 23, 2024
Question 1

What will be the output of the following code?
def get_number():
    for i in []:
        yield i
 
print(next(get_number()))


Answer: B
Question 2

What will be the output of the following code?
def first(x):
        return x ** x
 
def second(x):
        return first(x) + first(x)
 
print(second(3))


Answer: A
Question 3

Which of the following does the Python interpreter verify before executing Python code?


Answer: B
Question 4

What will be the output of the following snippet?
def show_truth():
    mysterious_var = 'New Surprise!'
    print(mysterious_var)
 
mysterious_var = 'Surprise!'
print(mysterious_var)
show_truth()
print(mysterious_var)


Answer: C
Question 5

What will happen after the following code snippet is run?
names = {'Tom': 10, 'Mary': 20}
names[20]


Answer: C
Page:    1 / 36   
Total 180 questions | Updated On: Apr 23, 2024

Quickly grab our PCEP-30-02 product now and kickstart your exam preparation today!

Name: Certified Entry-Level Python Programmer
Exam Code: PCEP-30-02
Certification: PCEP
Vendor: Python Institute
Total Questions: 180
Last Updated: Apr 23, 2024