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

WGU D335 Introduction to Programming in Python OA Study Guide | Objective Assessment Review 2025

Document preview thumbnail
Preview 4 out of 52 pages

Prepare for WGU D335 Introduction to Programming in Python Objective Assessment with targeted practice questions and study materials. Covers essential Python topics including data types, control flow, loops, functions, strings, lists, dictionaries, error handling, and file I/O. Aligned to the OA format and WGU competency requirements. Organized for efficient review of key programming concepts and syntax.

Content preview

1|Page




WGU D335 Introduction to
Programming in Python OA Study
Guide | Objective Assessment Review
2025




Prepare for WGU D335 Introduction to Programming in
Python Objective Assessment with targeted practice
questions and study materials. Covers essential Python
topics including data types, control flow, loops,
functions, strings, lists, dictionaries, error handling, and
file I/O. Aligned to the OA format and WGU competency
requirements. Organized for efficient review of key
programming concepts and syntax.




1. What is the primary purpose of the input() function in Python?
A. To display output to the console
B. To read user input from the keyboard
C. To convert a string to an integer
D. To write data to a file

,2|Page


B. To read user input from the keyboard
The input() function pauses program execution and waits for the user to type
something, returning that input as a string. It does not display output
(that's print()), convert types (that's int()), or write to files.

2. Which of the following is a valid variable name in Python?
A. 2nd_place
B. total-score
C. user_name
D. class
C. user_name
Variable names cannot start with a digit (A), contain hyphens (B), or be
reserved keywords like class (D). Underscores are allowed,
making user_name valid.

3. What data type does the expression produce in Python 3?
A. int
B. float
C. string
D. boolean
B. float
In Python 3, the single forward slash / always performs true division and
returns a float, so yields 2.5. To get an integer, you would use //.

4. What is the output of print(type(3.14))?
A. <class 'int'>
B. <class 'float'>
C. <class 'str'>
D. <class 'double'>
B. <class 'float'>
The type() function returns the class of the value. Since 3.14 has a decimal point,
it is a float, and Python represents it as <class 'float'>. There is no double type
in Python.

5. Which operator is used for exponentiation in Python?
A. ^
B. **
C. //
D. %
*B. **
The ** operator raises a number to a power, e.g., 2 ** 3 equals 8. The ^ symbol is
a bitwise XOR, not exponentiation.

,3|Page


6. What does the % operator return?
A. The percentage of two numbers
B. The remainder of division
C. The quotient of division
D. The absolute value
B. The remainder of division
The modulus operator % returns the remainder after division. For example, 10 %
3 returns 1. It is not used for calculating percentages directly.

7. What is the result of 10 // 3?
A. 3.33
B. 3
C. 4
D. 3.0
B. 3
The // operator performs floor division, which divides and rounds down to the
nearest whole number. Since is 3.33..., floor division returns 3.

8. Which of the following is an immutable data type?
A. list
B. dictionary
C. set
D. tuple
D. tuple
Tuples cannot be changed after creation, making them immutable. Lists,
dictionaries, and sets are all mutable, meaning their contents can be modified.

9. How do you create a single-line comment in Python?
A. // comment
B. /* comment */
C. # comment
D. -- comment
C. # comment
Python uses the hash symbol # for single-line comments. The other symbols are
used in languages like C, Java, or SQL.

10. What is the correct way to define a function in Python?
A. function myFunc():
B. def myFunc():
C. define myFunc():
D. func myFunc():
B. def myFunc():
The keyword def is used to define a function in Python, followed by the function
name, parentheses, and a colon.

, 4|Page


11. What will print("Hello" + "World") output?
A. Hello World
B. HelloWorld
C. Hello+World
D. Error
B. HelloWorld
The + operator concatenates strings without adding a space. To include a space,
you would need "Hello " + "World" or use a comma in print().

12. Which method converts a string to all uppercase letters?
A. .upper()
B. .uppercase()
C. .toUpper()
D. .capitalize()
A. .upper()
The .upper() method returns a copy of the string with all characters converted to
uppercase. .capitalize() only capitalizes the first letter.

13. What is the output of len("Python")?
A. 5
B. 6
C. 7
D. Error
B. 6
The len() function returns the number of characters in a string. "Python" has 6
characters: P, y, t, h, o, n.

14. Which of the following is NOT a valid Python data type?
A. int
B. float
C. char
D. bool
C. char
Python does not have a separate char type; single characters are simply strings
of length 1. The other options are all valid Python types.

15. What does the bool data type represent?
A. Only integers
B. Only strings
C. True or False values
D. Floating-point numbers
C. True or False values
The bool type has only two possible values: True and False. It is often used in
conditional statements.

Document information

Uploaded on
September 12, 2026
Number of pages
52
Written in
2026/2027
Type
Exam (elaborations)
Contains
Questions & answers
$25.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.
GradeGlide
3.8
(5)
Sold
30
Followers
3
Items
726
Last sold
2 days 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