Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

Code for PCEP Questions and Answers 2024

Rating
-
Sold
-
Pages
5
Grade
A+
Uploaded on
27-11-2024
Written in
2024/2025

Exam of 5 pages for the course PCEP at PCEP (Code for PCEP)

Institution
PCEP
Course
PCEP

Content preview

Code for PCEP

list_1 = ["A", "B", "C"]
list_2 = list_1
list_3 = list_2

del list_1[0]
del list_2
print(list_3) - answer['B', 'C']

nums = [1, 2, 3]
vals = nums
del vals[1:2]
print(nums) - answer[1, 3]

i=0
while i <= 3:
i += 2 # On first iteration, i becomes 2
print("*") # 2 is less than 3 so the loop prints another "*"
# Because 2+2 > 3, the loop stops and only 2 "*"s are printed - answer*
*

var = 1
# First iteration, 1 < 10, "#" is printed
# THEN var is incremented
# var << 1 = var * 2^1 = 2

# Second iteration, 2<10, "#" is printed
# 2*2^1 = 4

# Third iteration, 4 < 10, "#" is printed
# 4 * 2^1 = 8

# Fourth iteration, 8 < 10, "#" is printed
# 8 * 2^1 = 16

# 16 > 10, loop stops, 4 "#"s printed

while var < 10:
...print("#")
var = var << 1 - answer#
#
#

, #

my_list = [1, 2, 3]

for v in range(len(my_list)):
my_list.insert(1, my_list[v])

print(my_list)

# First iteration: my_list[v] is my_list[0], which is 1
# my_list becomes [1, 1, 2, 3]
# This means that my_list[1] = 1
# # my_list becomes [1, 1, 1, 2, 3] - answer[1, 1, 1, 1, 2, 3]

# Example 1
def wishes():
print("My Wishes")
return "Happy Birthday"
wishes() # outputs: My Wishes

# Example 2
def wishes():
print("My Wishes")
return "Happy Birthday"
print(wishes())
# outputs: My Wishes
# Happy Birthday - answerMy Wishes
My Wishes
Happy Birthday

def hi():
return
print("Hi!")
hi() - answerNothing gets outputted b/c theres nothing attached to the return statement

def fun(x):
global y
y=x*x
return y
fun(2)
print(y) - answer4

def fun(x):
if x % 2 == 0:
return 1
else:

Written for

Institution
PCEP
Course
PCEP

Document information

Uploaded on
November 27, 2024
Number of pages
5
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers
$15.99
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF


Also available in package deal

Thumbnail
Package deal
PCEP EXAM BUNDLE 2024
-
31 2024
$ 452.69 More info

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
julianah420 Phoenix University
View profile
Follow You need to be logged in order to follow users or courses
Sold
683
Member since
3 year
Number of followers
328
Documents
35276
Last sold
2 days ago
NURSING,TESTBANKS,ASSIGNMENT,AQA AND ALL REVISION MATERIALS

On this page, you find all documents, package deals, and flashcards offered by seller julianah420

4.2

155 reviews

5
102
4
21
3
11
2
5
1
16

Trending documents

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions