• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 4 fuera de 52 páginas
Examen

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

Document preview thumbnail
Vista previa 4 fuera de 52 páginas

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.

Vista previa del contenido

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.

Información del documento

Subido en
12 de septiembre de 2026
Número de páginas
52
Escrito en
2026/2027
Tipo
Examen
Contiene
Preguntas y respuestas
$25.99

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
GradeGlide
3.8
(5)
Vendido
28
Seguidores
3
Artículos
717
Última venta
1 día hace



Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes