Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 2 out of 5 pages
Summary

WGU D487: Python Summary | 2026 Update

Document preview thumbnail
Preview 2 out of 5 pages

WGU D487: Python Summary | 2026 Update

Content preview

Summary of Key Concepts for Your Python Exam
This cheat sheet provides a solid overview of core Python syntax and data
structures. You should aim to understand how to use each of these
concepts and what their typical output will be.

1. Variables and Data Types (The Building Blocks)
● Declaration & Assignment:
○ Assigning single values (myVar = 5).
○ Assigning return values from functions (myVar = myFunction()).
○ Multiple variable assignment on one line (var1, var2, var3 = 1, 2, 3).
● Fundamental Data Types:
○ Integers (int): Whole numbers (e.g., 12).
○ Floats (float): Numbers with decimal points (e.g., 12.0).
○ Strings (str):): Text enclosed in single or double quotes (e.g.,
"twelve", '12').
○ Booleans (bool): True or False.
● Type Operations:
○ type(): Check the data type of a variable.
○ Type Conversion (Casting): int(), float(), str(). Understand how
these convert between types (e.g., int(12.0) becomes 12, float(12)
becomes 12.0).
○ round(): Rounds a float to the nearest whole number.
○ print(): Display output to the console.

2. Operators (How to Manipulate Data)
● Arithmetic Operators:
○ + (addition), - (subtraction), * (multiplication), / (division - always float
result).
○ // (Floor Division): Get the whole number result of division (e.g., 2.1 //
2 is 1.0, 5 // 2 is 2). Crucial to understand.
○ % (Modulo): Get the remainder of a division (e.g., 5 % 2 is 1). Pairs
with floor division.
○ ** (Exponentiation/Power of).
● Assignment/Reassignment Operators:
○ = (simple assignment).
○ +=, -=, *=, /=: Shorthand for performing an operation and assigning
the result back to the variable (e.g., myNum += 5 is myNum =
myNum + 5).
● Comparison Operators (For Conditional Logic):

, ○ < (less than), > (greater than), <= (less than or equal to), >=
(greater than or equal to).
○ == (equal to), != (not equal to).
○ These always result in a Boolean (True or False) value.

3. Strings (Working with Text)
● Basic Properties:
○ len(): Get the length of a string.
○ Slicing: Extract parts of a string using [start:end] (e.g., name[0:4]).
Remember end is exclusive.
● Key String Methods:
○ .title(): Capitalizes the first letter of each word.
○ .islower(): Checks if all characters are lowercase.
○ .count('substring'): Counts occurrences of a substring.
○ .format() (and implicitly f-strings, though not explicitly shown):
Format strings by inserting values into placeholders (e.g., "Welcome
to {}, {}.".format(code, username)). Very important for output.
○ .split("delimiter"): Splits a string into a list of substrings based on a
delimiter (e.g., myPhrase.split(" ")).
4. Functions (Reusable Code Blocks)
● Definition: def function_name(parameter1, parameter2):
● Input (Parameters/Arguments): Values passed into the function.
● Output (Return Value): Use return to send a value back from the
function. If no return, the function implicitly returns None.
● Calling: Execute a function by its name with arguments (e.g., myArea =
areaOf(4,6)).
5. Control Flow (Making Decisions and Repetitions)
● If / Elif / Else Statements (Decision Making):
○ if condition:: Executes if the condition is True.
○ elif condition:: An alternative condition if the preceding if/elif were
False.
○ else:: Executes if all preceding if/elif conditions were False.
○ Indentation is critical for defining blocks of code.
● Boolean Operations (and, or, not):
○ and: True only if both sides are True.
○ or: True if at least one side is True.
○ not: Reverses the Boolean value (not True is False, not False is True).
● For Loops (Iterating through collections):

Document information

Uploaded on
July 17, 2026
Number of pages
5
Written in
2025/2026
Type
Summary
$12.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.
NaireExams
4.1
(50)
Sold
184
Followers
170
Items
2955
Last sold
2 weeks 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