• 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 35 pages
Exam (elaborations)

Wgu Python D522 Updated Actual Questions With Correct Answers

Document preview thumbnail
Preview 4 out of 35 pages

Wgu Python D522 Updated Actual Questions With Correct Answers

Content preview

WGU PYTHON D522 UPDATED ACTUAL QUESTIONS
WITH CORRECT ANSWERS

Question 1.
What kind of variable would x = [ ] result in?

ANSWER
list


Question 2.
What is a Name Error?

ANSWER
program tries to use a variable that does not exist


Question 3.
What are the identity operators?

ANSWER
is, is not


Question 4.
print(bool("Hello")) print(bool("15")) print(bool(x))
ANSWER
Boolean examples of True


Question 5.
float( )
ANSWER
casts a float from an integer literal, a float literal, or a string literal






,Question 6.
What is a continue statement?
ANSWER
Causes a loop to immediately jump back to the while or for statement


Question 7.
How do you denote a modifier in an f-string placeholder?
ANSWER
in placeholder, after name of variable or value, use a : followed by formatting type e.g., txt =
f"The price is {95:.2f} dollars"


Question 8.
How do you denote a placeholder in an f-string?

ANSWER
{}
e.g., txt = f"The price is {price} dollars"


Question 9.
What is the modifier to show the value in decimal format?
ANSWER
:d


Question 10.
What are some characteristics of a tuple?
ANSWER
ordered; unchangeable; allows duplicate values






,Question 11.
How to print an * rectangle
ANSWER
num_rows = int(input())
num_cols = int(input())
for a in range(num_rows):
for b in range(num_cols):
print('*', end=' ')
print()


Question 12.
What is the modifier to show the value in hex format?

ANSWER
:x lowercase
:X uppercase


Question 13.
What is dynamic typing?
ANSWER
the interpreter determines the type of objects as the program executes; the programmer does
not have to define them


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

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


Question 15.
print(a.replace("H", "J"))
ANSWER
replace a string with another string





, Question 16.
What modifiers are used to set thousand separators?
ANSWER
:, comma
:_ underscore


Question 17.
What built-in data type is used when you assign a set to your variable?

ANSWER
set
x = {"apple", "banana", "cherry"}
x = set(("apple", "banana", "cherry"))

frozenset
x = frozenset({"apple", "banana", "cherry"})
x = frozenset(("apple", "banana", "cherry"))


Question 18.
What does an interpreter do with objects?

ANSWER
creates and manipulates objects as needed to run code; assigns an object to a location
somewhere in memory


Question 19.
What is the modifier to show the value in scientific format?
ANSWER
:e
:E for uppercase E


Question 20.
How do you name a variable versus a constant?

ANSWER
variable_name CONSTANT_NAME

Document information

Uploaded on
November 3, 2026
Number of pages
35
Written in
2026/2027
Type
Exam (elaborations)
Contains
Questions & answers
$17.99

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.
TopGradeInsider
4.1
(14)
Sold
207
Followers
1
Items
68186
Last sold
14 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