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

WGU C859 Python Syntax — Intensive Multiple-Choice Exam

Document preview thumbnail
Preview 3 out of 25 pages

WGU C859 Python Syntax — Intensive Multiple-Choice Exam

Content preview

WGU C859 Python Syntax — Intensive Multiple-Choice Exam


1. Which of the following represents an integer literal in Python?

A. 12.0
B. "12"
C. 12
D. '12'

Correct Answer: C. 12

Rationale:
An integer is a whole number without a decimal point. 12 is an integer literal. 12.0 is a float, and
"12" or '12' are strings because they are enclosed in quotation marks.




2. Which of the following represents a float value?

A. 1.2
B. 1
C. "1.2"
D. True

Correct Answer: A. 1.2

Rationale:
A float (floating-point number) contains a decimal point. "1.2" is a string, 1 is an integer, and
True is Boolean.




3. What data type is represented by 'twelve'?

A. Integer
B. Boolean
C. Float
D. String

Correct Answer: D. String

,Rationale:
Any value enclosed in single or double quotation marks is a string object in Python.



4. What is the purpose of the type() function?

A. Converts data types
B. Prints data
C. Determines the type of an object
D. Formats output

Correct Answer: C. Determines the type of an object

Rationale:
type() returns the class/type of an object (e.g., int, float, str, bool).




5. What does the int() function do?

A. Converts to string
B. Converts to float
C. Determines type
D. Converts a value to an integer object

Correct Answer: D. Converts a value to an integer object

Rationale:
int() casts a value into an integer when possible (e.g., int("5") → 5).




6. What is the result of the / operator in Python?

A. Always integer
B. Always string
C. Always float
D. Depends on operands

Correct Answer: C. Always float

Rationale:
In Python 3, / performs true division and always returns a float (e.g., 4/2 → 2.0).

, 7. Which operator performs exponentiation?

A. ^
B. *
C. //
D. **

Correct Answer: D. **

Rationale:
** raises a number to a power (e.g., 2**3 → 8). ^ is bitwise XOR.




8. What does // represent in Python?

A. Modulus
B. Float division
C. Integer (floor) division
D. Power

Correct Answer: C. Integer (floor) division

Rationale:
// performs floor division and returns an integer result (e.g., 5//2 → 2).




9. What does the += operator do?

A. Assigns
B. Compares equality
C. Adds and reassigns
D. Divides and reassigns

Correct Answer: C. Adds and reassigns

Rationale:
x += 3 is equivalent to x = x + 3.




10. Which comparison operator checks inequality?

Document information

Uploaded on
February 13, 2026
Number of pages
25
Written in
2025/2026
Type
Exam (elaborations)
Contains
Unknown
$15.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.
Estudyr
3.8
(222)
Sold
1228
Followers
830
Items
11238
Last sold
1 week 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