• Verkeerd document? Gratis ruilen
  • Geschreven door studenten die geslaagd zijn
  • Direct beschikbaar na je betaling
  • Online lezen of als PDF
Verkopen
Kies je studieland
Kies je taal
Document preview thumbnail
Voorbeeld 4 van de 52 pagina's
Tentamen (uitwerkingen)

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

Document preview thumbnail
Voorbeeld 4 van de 52 pagina's

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.

Voorbeeld van de inhoud

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.

Documentinformatie

Geüpload op
12 september 2026
Aantal pagina's
52
Geschreven in
2026/2027
Type
Tentamen (uitwerkingen)
Bevat
Vragen en antwoorden
$25.99

Verkeerd document? Gratis ruilen Binnen 14 dagen na aankoop en voor het downloaden kun je een ander document kiezen. Je kunt het bedrag gewoon opnieuw besteden.
Geschreven door studenten die geslaagd zijn
Direct beschikbaar na je betaling
Online lezen of als PDF

Seller avatar
De reputatie van een verkoper is gebaseerd op het aantal documenten dat iemand tegen betaling verkocht heeft en de beoordelingen die voor die items ontvangen zijn. Er zijn drie niveau’s te onderscheiden: brons, zilver en goud. Hoe beter de reputatie, hoe meer de kwaliteit van zijn of haar werk te vertrouwen is.
GradeGlide
3.8
(5)
Verkocht
28
Volgers
3
Items
717
Laatst verkocht
1 dag geleden



Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Bezig met je bronvermelding?

Maak nauwkeurige citaten in APA, MLA en Harvard met onze gratis bronnengenerator.

Bezig met je bronvermelding?

Veelgestelde vragen