• 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 3 out of 20 pages
Exam (elaborations)

WGU D335 Intro to Python Comprehensive

Document preview thumbnail
Preview 3 out of 20 pages

. A named item used to hold a value in a program is called a: a) Function b) Variable c) Loop d) Operator

Content preview

WGU D335 Intro to Python – Comprehensive
Practice Exam

1. A named item used to hold a value in a program is called a:

a) Function

b) Variable

c) Loop

d) Operator



CORRECT ANSWER: b) Variable



2. Which of the following is a correct way to create a comment in Python?

a) `// This is a comment`

b) `<! This is a comment `

c) `# This is a comment`

d) `/* This is a comment */`



CORRECT ANSWER: c) `# This is a comment`



3. What is the data type of `x` after the assignment `x = 5.0`?

a) int

b) float

,c) str

d) bool



CORRECT ANSWER: b) float



4. What is the output of `print(3 + 2.5)`?

a) 5

b) 5.5

c) 6

d) Error



CORRECT ANSWER: b) 5.5 (Python performs implicit type conversion)



5. Which function is used to get text input from a user?

a) `print()`

b) `get()`

c) `input()`

d) `scan()`



CORRECT ANSWER: c) `input()`



6. To convert a string like `"123"` into an integer, you would use:

a) `string()`

b) `int()`

c) `float()`

, d) `str()`



CORRECT ANSWER: b) `int()`



7. Which of the following is NOT a valid variable name in Python?

a) `my_var`

b) `_myvar`

c) `2myvar`

d) `myVar2`



CORRECT ANSWER: c) `2myvar` (Variable names cannot start with a number)



8. What does the `type()` function do?

a) Changes the data type of a variable.

b) Deletes a variable.

c) Returns the data type of a value or variable.

d) Creates a new type of variable.



CORRECT ANSWER: c) Returns the data type of a value or variable.



9. If you want to keep multiple `print()` statements on the same line, you use:

a) `sep=' '`

b) `end=' '`

c) `line=' '`

d) `\n`

Document information

Uploaded on
March 16, 2026
Number of pages
20
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$19.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

Sold
1
Followers
0
Items
22
Last sold
3 year 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