• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 4 out of 34 pages
Exam (elaborations)

Wgu Python D522 Updated Actual Questions With Correct Answers

Document preview thumbnail
Preview 4 out of 34 pages

Wgu Python D522 Updated Actual Questions With Correct Answers

Content preview

WGU PYTHON D522 UPDATED ACTUAL QUESTIONS
WITH CORRECT ANSWERS

Question 1.
Which Python datatypes allow arrays with duplicates?

ANSWER
list and tuple



Question 2.
print(~ 3)

ANSWER
bitwise operator NOT
inverts all the bits
3 (0000000000000011)

-4 (1111111111111100)



Question 3.
Which modifiers are used to show a value's positive or negative sign?

ANSWER
i. := shows negative sign in the left most position
ii. :+ shows sign for positive and negative numbers
iii. :- shows sign for negative number only
iv. :(space) shows sign for negative and an extra space for a positive number



Question 4.
print(6 ^ 3)

ANSWER
bitwise operator XOR
compare bits and set each bit to 1 if only one bit is 1
6 (0000000000000110)
3 (0000000000000011)

5 (0000000000000101)






,Question 5.
What is a sequence type?

ANSWER
a collection of objects ordered from left to right; the first object is 0; each object's position is its
index



Question 6.
How do you determine how many items are in a list?

ANSWER
print(len(yourlist))



Question 7.
What is a continue statement?

ANSWER
Causes a loop to immediately jump back to the while or for statement



Question 8.
Fastest way to isolate and remove the last digit of an integer

ANSWER
i. % 10
ii. // 10



Question 9.
What does != mean?

ANSWER
not equal to






,Question 10.
Can you generate random numbers in Python?

ANSWER
i. no random function, but there is a random module
ii. import random
iii. print(random.randrange(1,10))



Question 11.
print(a.replace("H", "J"))

ANSWER
replace a string with another string



Question 12.
What is the modifier to show the value in fix point number format?

ANSWER
i. if number not specified, shows 6 digits after decimal
ii. :f show inf and nan lowercase
iii. :F show inf and nan uppercase



Question 13.
What is the modifier to show the value in the corresponding Unicode character?

ANSWER
:c



Question 14.
What modifiers are used to set thousand separators?

ANSWER
i. :, comma
ii. :_ underscore






, Question 15.
What is an integer?

ANSWER
positive or negative whole number of unlimited length



Question 16.
What are the bitwise operators?

ANSWER
&
|
^
~
<<
>>



Question 17.
What is enumerate( )?

ANSWER
retrieves the index and value of an element in a list



Question 18.
a=(f"My name is John, I am {age}")
print(a)

ANSWER
f-string; { } is the placeholder/modifier



Question 19.
What is the modifier to show the value in decimal format?

ANSWER
:d

Document information

Uploaded on
October 21, 2026
Number of pages
34
Written in
2026/2027
Type
Exam (elaborations)
Contains
Questions & answers
$18.00

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

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.
FocusFile7
4.0
(29)
Sold
306
Followers
5
Items
78112
Last sold
2 hours ago



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

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions