WGU D335 PROFESSIONAL EXAM
REVIEW WITH TESTED QUESTIONS AND
EXPERT SOLUTIONS
◉ for loop
Answer: Repeats an action for everything in a container.
◉ while loop
Answer: Repeats an action based on a condition.
◉ range() function
Answer: Generates a sequence of numbers within a specified
range.
◉ F strings
Answer: Allows for easy formatting of strings in Python.
◉ dictionary
Answer: Data structure with key-value pairs, where keys must be
unique.
◉ name error
Answer: The program tries to use a variable that does not exist.
,◉ type error
Answer: An operation uses incorrect types - can occur if adding an
integer to a string.
◉ logic error (bug)
Answer: Program runs but does the wrong thing.
◉ whitespace
Answer: Any blank space or new line.
◉ = (assignment operator)
Answer: Assigns a variable with a value.
◉ incrementing
Answer: Increasing variables by a value of 1.
◉ float( )
Answer: A number with a decimal point.
◉ stocks
Answer: {'TSLA': 912.86 , 'BBBY': 24.84, 'AAPL': 174.26, 'SOFI':
6.92, 'KIRK': 8.72, 'AURA': 22.12, 'AMZN': 141.28, 'EMBK': 12.29,
'LVLU': 2.33}
, ◉ purchase
Answer: {"bananas": 1.85, "steak": 19.99, "cookies": 4.52, "celery":
2.81, "milk": 4.34}
◉ cost_of_stocks
Answer: Total cost of the purchased shares of stock calculated
from the stock selections.
◉ total_purchase_cost
Answer: Total cost of the grocery store items purchased, adjusted
for discounts based on quantity.
◉ discount for 10-20 items
Answer: If between ten and twenty items (inclusive) are
purchased, the purchase gets a 5% discount.
◉ discount for 21 or more items
Answer: If twenty-one or more items are purchased, the purchase
gets a 10% discount.
◉ sentence
Answer: A new sentence string composed of three existing words
from a text file.
REVIEW WITH TESTED QUESTIONS AND
EXPERT SOLUTIONS
◉ for loop
Answer: Repeats an action for everything in a container.
◉ while loop
Answer: Repeats an action based on a condition.
◉ range() function
Answer: Generates a sequence of numbers within a specified
range.
◉ F strings
Answer: Allows for easy formatting of strings in Python.
◉ dictionary
Answer: Data structure with key-value pairs, where keys must be
unique.
◉ name error
Answer: The program tries to use a variable that does not exist.
,◉ type error
Answer: An operation uses incorrect types - can occur if adding an
integer to a string.
◉ logic error (bug)
Answer: Program runs but does the wrong thing.
◉ whitespace
Answer: Any blank space or new line.
◉ = (assignment operator)
Answer: Assigns a variable with a value.
◉ incrementing
Answer: Increasing variables by a value of 1.
◉ float( )
Answer: A number with a decimal point.
◉ stocks
Answer: {'TSLA': 912.86 , 'BBBY': 24.84, 'AAPL': 174.26, 'SOFI':
6.92, 'KIRK': 8.72, 'AURA': 22.12, 'AMZN': 141.28, 'EMBK': 12.29,
'LVLU': 2.33}
, ◉ purchase
Answer: {"bananas": 1.85, "steak": 19.99, "cookies": 4.52, "celery":
2.81, "milk": 4.34}
◉ cost_of_stocks
Answer: Total cost of the purchased shares of stock calculated
from the stock selections.
◉ total_purchase_cost
Answer: Total cost of the grocery store items purchased, adjusted
for discounts based on quantity.
◉ discount for 10-20 items
Answer: If between ten and twenty items (inclusive) are
purchased, the purchase gets a 5% discount.
◉ discount for 21 or more items
Answer: If twenty-one or more items are purchased, the purchase
gets a 10% discount.
◉ sentence
Answer: A new sentence string composed of three existing words
from a text file.