WGU E010 Foundations of Programming Guide

A plain-English guide to WGU E010 Foundations of Programming (Python): running code in IDEs and terminals, functions, lists and dicts, and debugging.

Stuck on WGU E010 Foundations of Programming (Python)? A tutor can walk you through it, one on one. Get help

Last checked: November 6, 2026. Course details come from WGU’s B.S. Cybersecurity and Information Assurance program guide and the WGU Institutional Catalog (October 2026). Course codes and requirements can change, so confirm on your WGU course page.

WGU E010 Foundations of Programming (Python) is a 3-unit course with no prerequisites. It teaches you to write and debug small Python programs, run them in more than one tool, build simple functions, and store data in lists and dictionaries. The best way through it is to write a little code every day and fix your own bugs.

WGU doesn’t publish E010’s assessment type on its public pages. Your course page shows whether it ends in an objective assessment (OA) or a performance assessment (PA). Our OA vs PA guide explains the difference.

WGU E010 at a glance

Course codeE010
Course nameFoundations of Programming (Python)
Competency units3
PrerequisitesNone, per WGU’s program guide
Where it sitsIn the B.S. Cybersecurity guide, it comes first in the programming group, before Version Control and Python for IT Automation
AssessmentNot stated on public WGU pages. Check your course page

How does E010 work?

You work through the course material, practice, and then show competency on the final assessment. WGU’s program guide says you’ll begin by discussing your course planning tool report with your instructor and building a course plan together. Book that call early. It’s the fastest way to learn exactly what your assessment looks like.

The October 2026 catalog lists E010 in 9 degree programs, including the B.S. Cybersecurity and Information Assurance, B.S. Computer Science, and B.S. Cloud and Network Engineering.

Is E010 the same as D335?

Not officially. D335 Introduction to Programming in Python is a separate course, and the October 2026 catalog lists it only in the B.S. Data Analytics. WGU doesn’t say that E010 replaced D335. Your degree plan tells you which one you have. Both teach beginner Python, so our D335 study guide is useful extra practice on syntax basics.

What does E010 cover?

WGU’s program guide lists four competencies. In plain English, you should be able to:

  1. Write and debug working programs. Not just code that runs, but code that gives the right answer.
  2. Run Python in different environments. That means an IDE, a text editor, and the command line.
  3. Use basic Python building blocks to write simple functions. Think parameters, return values, and conditions.
  4. Work with data structures. Store, find, and change data in lists, dictionaries, and similar types.

The rest of this guide takes each one in turn, with original examples.

How do you run Python in different environments?

Python code is the same everywhere, but how you start it changes. Learn three ways, and you won’t panic when a tool looks different from the one in your lessons.

The interactive prompt (REPL)

Type python3 (or python on Windows) in a terminal. You’ll see >>>. Each line runs as soon as you press Enter, which makes it great for quick tests:

>>> 15 * 4
60
>>> "net" + "work"
'network'

Type exit() to leave. Nothing you type here is saved.

A script run from the terminal

Save your code in a file such as inventory.py. In the terminal, move to that folder with cd, then run python3 inventory.py. If you see “No such file or directory”, you’re in the wrong folder. Run pwd (Mac and Linux) or cd on its own (Windows) to check where you are.

An IDE

An IDE, such as VS Code, PyCharm, or IDLE, gives you a Run button, color-coded code, and a debugger. It’s comfortable, but it hides some details. For example, the IDE might use a different Python version or a different working folder than your terminal.

Worked example: “It works in my IDE but not in the terminal”

Say your program opens devices.txt. It works when you press Run, but the terminal says FileNotFoundError. The likely cause is the working folder. The IDE starts in your project folder, but your terminal is somewhere else. Fix it by moving to the project folder first, or by checking os.getcwd() to print where Python thinks it is.

How do you write a simple function?

A function packages one job so you can reuse it. Give it inputs (parameters), let it decide things with conditions, and hand back a result with return.

Worked example: a password length checker

Here’s a task: return “strong” if a password has at least 12 characters, “okay” for 8 to 11, and “weak” otherwise.

def password_strength(pw):
    length = len(pw)
    if length >= 12:
        return "strong"
    elif length >= 8:
        return "okay"
    return "weak"

print(password_strength("sunflower"))        # okay (9 characters)
print(password_strength("blue-river-2026"))  # strong
print(password_strength("cat"))              # weak

Notice the order of the checks. If you test length >= 8 first, a 15-character password would return “okay”, because Python stops at the first true condition.

Default values

A parameter can have a default, so callers can skip it:

def greet(name, greeting="Hello"):
    return f"{greeting}, {name}!"

greet("Sam")           # 'Hello, Sam!'
greet("Sam", "Hi")     # 'Hi, Sam!'

Variables inside a function stay inside

A variable created inside a function disappears when the function ends. If you need the value later, return it and store it: result = password_strength("abc").

Which data structure should you use?

Picking the right container makes the rest of the code easier.

TypeLooks likeUse it when
List["r1", "r2", "r3"]Order matters, or you’ll add and remove items
Tuple(40.7, -74.0)The values belong together and shouldn’t change
Dictionary{"r1": "online"}You look things up by a name or ID
Set{"admin", "guest"}You need unique values or fast “is it in here?” checks

Worked example: counting login attempts

You have a list of usernames, one per login attempt, and you want a count for each user.

attempts = ["ana", "lee", "ana", "kofi", "ana", "lee"]

counts = {}
for user in attempts:
    counts[user] = counts.get(user, 0) + 1

print(counts)   # {'ana': 3, 'lee': 2, 'kofi': 1}

counts.get(user, 0) returns 0 the first time a name appears, so you don’t get a KeyError. To list each user once, use a set: set(attempts).

Worked example: a list of dictionaries

Real data is often a list of records:

servers = [
    {"name": "web1", "cpu": 72},
    {"name": "db1", "cpu": 91},
    {"name": "mail1", "cpu": 35},
]

busy = [s["name"] for s in servers if s["cpu"] > 80]
print(busy)   # ['db1']

Read it as “give me the name of each server whose CPU is over 80”.

How do you debug code that gives the wrong answer?

The hardest bugs don’t crash. The program runs and quietly prints the wrong thing. Use a routine instead of guessing.

  1. Say what you expected. Write the correct output for one small input before you run anything.
  2. Find where it goes wrong. Add a print() halfway through. If the value is already wrong there, the bug is earlier.
  3. Use the debugger. In an IDE, click beside a line number to set a breakpoint, then step through one line at a time and watch your variables change.
  4. Check with assert. assert password_strength("cat") == "weak" does nothing if it’s right and stops loudly if it’s wrong. A few of these act as a mini test suite.
  5. Explain it out loud. Walking through your code line by line, even to an empty room, often shows the mistake.

Worked example: an average that’s off

def average(nums):
    total = 0
    for n in nums:
        total = n        # bug
    return total / len(nums)

print(average([2, 4, 6]))   # prints 2.0, expected 4.0

A print inside the loop shows total going 2, 4, 6 instead of 2, 6, 12. The line should be total += n.

A suggested E010 study plan

This is our suggestion, not a WGU timeline. Move on when you can do each step without notes.

  1. Set up your tools. Run the same short program in the REPL, from the terminal, and in an IDE.
  2. Basics. Variables, types, input(), and if statements. Write a tiny program for each.
  3. Functions. Write five small functions that each return a value, then test each with assert.
  4. Data structures. Rebuild the login counter and server filter above from memory, then change them.
  5. Debugging. Break your own working code on purpose, then fix it with prints and the debugger.
  6. Review. Use your course’s practice material and go back to any step that felt shaky.

Common E010 mistakes

  • Running the file from the wrong folder, then thinking the code is broken.
  • Mixing up Python versions, for example installing a package for one version and running another.
  • Using sorted() and .sort() the wrong way. nums.sort() changes the list and returns None, so nums = nums.sort() wipes it out. sorted(nums) returns a new list.
  • Changing a list while looping over it. Items get skipped. Loop over a copy, or build a new list.
  • Naming a variable list, dict, or str. It hides the built-in, and later code breaks in confusing ways.
  • Reading a missing dictionary key with d["key"]. Use d.get("key") when the key might not exist.

Practice problems (original)

  1. What does {"a": 1, "b": 2}.get("c", 0) return?
  2. What’s printed by x = [3, 1, 2] then print(x.sort())?
  3. Write first_and_last(items) that returns a tuple of the first and last item in a list.
  4. You run python3 report.py and get “can’t open file”. Name the most likely cause.
  5. Turn ["tcp", "udp", "tcp", "icmp"] into the unique values only.

Solutions

  1. 0, because “c” isn’t a key and 0 is the default.
  2. None. The list is sorted in place, but .sort() doesn’t return it.
  3. One answer:
def first_and_last(items):
    return (items[0], items[-1])
  1. The terminal isn’t in the folder that holds report.py, or the file name is misspelled.
  2. set(["tcp", "udp", "tcp", "icmp"]) gives {"tcp", "udp", "icmp"}. Order isn’t kept in a set.

If you did not pass E010

Don’t worry. A failed attempt shows you exactly what to practice next. If you took an OA, read your coaching report, list your weakest areas, and rebuild those with new practice programs. Use the 7-day WGU retake plan and check the WGU retake policy. If your work came back for revision, our guide to fixing a returned performance assessment walks through the evaluator’s comments. Either way, talk with your instructor. The WGU retake hub has more help.

WGU E010 FAQ

Do I need any coding experience for E010? No. WGU’s program guide lists no prerequisites, and the course starts with the basics.

Which IDE should I use? Use the one your course materials recommend. The competency covers more than one environment, so also practice running a file from the terminal.

Does E010 transfer in from another school? It might. WGU’s Accelerated Computer Science transfer guideline lists it among courses that can clear with an equivalent college course. See our B.S. Computer Science transfer map and ask your Enrollment Counselor.

What comes after E010? In the B.S. Cybersecurity program guide, the programming group runs E010, then Version Control, then D522 Python for IT Automation. Your degree plan may differ.

PassPathways is an independent resource and is not affiliated with WGU. This guide contains original explanations and practice problems, not actual exam questions.

Back to the WGU study guides.

Stuck on this course? Get one-on-one tutoring.

Tell us what you want, and we'll reply with how a tutor can help. We teach and coach. When you're ready, agree to our terms below.

Get started

Learn about WGU tutoring

Want help with WGU E010 Foundations of Programming (Python)?

Reading a guide is a great start, but some topics click faster when someone explains them to you. Our tutors work one on one with WGU students.

  1. Tell us where you're stuck. Share your course and what feels hard.
  2. We reply on WhatsApp or email. No forms to wait on if you'd rather chat.
  3. A tutor explains it and builds a plan with you, so you understand the material and pass on your own.
  • Original guides, fact-checked against official WGU sources
  • Honest, ethical tutoring: we teach, you do your own work
  • Free practice quizzes to check your progress
Need help with this course? WhatsApp Message