Your DevOps study space

Real explanations. Videos with tests. Fresh exams every time. Keep the streak alive and watch the XP stack up.

Operators & expressions · Python Docs · StackwisePlanDevOps Operators & expressions · Python Docs · StackwiseCodePython Operators & expressions · Python Docs · StackwiseBuildDocker Operators & expressions · Python Docs · StackwiseTestDevOps Operators & expressions · Python Docs · StackwiseReleaseGit Operators & expressions · Python Docs · StackwiseDeployKubernetes Operators & expressions · Python Docs · StackwiseOperateLinux Operators & expressions · Python Docs · StackwiseMonitorDevOps

Pick a topic

Eight tracks, each with docs, a cheat sheet, videos and tests.

How it works

One loop, repeated until it sticks.

Jump back in

Picked up from where you left off.

Free forever

Your DevOps journey starts with one click.

Sign in with Google or GitHub to open every chapter, video, test and challenge. Your progress is saved wherever you learn.

Operators & expressions

Operators combine values into new ones. Most behave like school maths, but a few (division, equality versus identity, and how and/or work) trip people up in exams and in real code.

Arithmetic

7 + 2    # 9
7 - 2    # 5
7 * 2    # 14
7 / 2    # 3.5   (/ always gives a float)
7 // 2   # 3     (floor division: drop the remainder)
7 % 2    # 1     (modulo: just the remainder)
2 ** 3   # 8     (power)

% is more useful than it looks: n % 2 == 0 tests for even numbers, and i % 10 == 0 does something every tenth time in a loop. + also joins strings and lists, and "ab" * 3 repeats a string ('ababab').

Order of operations: ** first, then * / // %, then + -, left to right. 2 + 3 * 4 is 14; use brackets when in doubt: (2 + 3) * 4 is 20. Shortcuts like count += 1 mean count = count + 1.

Comparisons

== != < > <= >= compare values and give True or False. They can be chained: 1 < x < 10. The in operator tests membership in strings, lists, sets and dict keys: "prod" in env_name, port in [80, 443].

== versus is

== asks "do these have the same value?"; is asks "are these the very same object in memory?".

a = [1, 2, 3]
b = [1, 2, 3]
a == b   # True: same contents
a is b   # False: two separate lists

Use == for comparing values. The one standard use of is is checking for None: if result is None:.

Boolean logic and truthiness

and is true only if both sides are, or if either is, not flips a value. They short-circuit: Python stops as soon as the answer is known, so in user and user.is_admin the second part never runs if user is None.

Every value also counts as true or false in an if. "Falsy" values are False, None, 0, empty strings, and empty lists/dicts/sets; everything else is "truthy". That's why if errors: works as "if the list has anything in it".

Indexing and slicing

Strings and lists are numbered from 0. Negative numbers count from the end: items[-1] is the last one. A slice items[start:stop] includes start but stops before stop, so items[1:3] gives positions 1 and 2. Leave a side empty to go to the edge: items[:3] is the first three, items[::-1] is reversed.

indexfrom endD0-6E1-5V2-4O3-3P4-2S5-1s[1:4] -> "EVO" starts at 1, stops before 4s[-1] -> "S" s[:3] -> "DEV" s[::-1] -> "SPOVED"
Count from 0 at the front or from -1 at the back. A slice includes its start and stops just before its end, so s[1:4] is three items.

Operators at work

Here's a small, realistic calculation: how full is a disk, as a percentage with one decimal?

used_gb = 412
total_gb = 500
percent = used_gb / total_gb * 100        # 82.39999999999999
print(f"Disk is {round(percent, 1)}% full")   # Disk is 82.4% full
print("warning" if percent > 80 else "ok")   # warning: a one-line if/else

A few built-in functions do a lot of everyday maths for you: round(x, 1), min(a, b), max(list), sum(list) and abs(-5).

Common mistakes

  • = versus ==: one equals sign stores a value, two compare. if status = "ok": is a SyntaxError; you meant ==.
  • Decimals aren't exact: 0.1 + 0.2 gives 0.30000000000000004, because computers store decimals in binary. Round before you display, and don't test floats with ==; use abs(a - b) < 0.0001.
  • Text that looks like a number: "10" == 10 is False, and "10" < 5 is a TypeError. Values from files, input() and command arguments are text until you convert them.
  • Floor division with negatives: -7 // 2 is -4, not -3. It rounds down, towards minus infinity.

Try it yourself

  1. Write one line that is True only when port is a valid port number (1 to 65535).

    Show an answer
    1 <= port <= 65535

    Chained comparisons read just like maths.

  2. filename = "backup-2026-09-30.tar.gz". Use slicing to get the date part 2026-09-30.

    Show an answer
    filename[7:17]

    Count from 0: the date starts at position 7 and the slice stops before 17.

  3. Without running it, what do these give: 7 // 2, 7 % 2, 2 ** 10, bool("")?

    Show an answer

    3, 1, 1024 and False (an empty string is falsy).

Questions

Pick an answer. Get it wrong and you can try again right away, no waiting. 10 questions per topic - pick a filter below, then use Recreate questions for a fresh set on that topic.

Fresh questions every time

Exam

A mixed test across the whole site, shuffled so you never know which topic comes next. When you submit, every mistake comes with the reason and a jump to the exact moment in the video that explains it.

30 questions 6 topics 20 minute limit Up to 70 XP
1–4 answer · ←→ move
History

Essay

0 / 200-250 words
Sample answer
History
0:00 / 0:00
Not started

on YouTube
Subscribe

Topic progress

Activity

Achievements

Settings

Your profile and your account.

Profile details

* Required. Saved in this browser until you sign in.

Letters, numbers, dots, dashes and underscores.
0 / 160

Account

Checking…

App

Install Stackwise on your phone or computer. It opens in its own window from your home screen, and the Docs and cheat sheets you've opened keep working without internet.

Only admins can see this

Dashboard

Sign-ups, activity, messages and reviews in one place.

Prove it

Certificates

Pass a topic's test and get a certificate with its own public page you can share or add to LinkedIn. Each test is 10 questions drawn at random and graded on the server; you need 8 right, you have 15 minutes, and you get one try per topic a day.

From first command to production

Linux for DevOps

A path through Linux the way DevOps engineers use it: ten stages, every command explained with its flags, examples, real output and mistakes, the combinations engineers chain together, and incidents worked through step by step. Practise everything in a safe lab folder.

Before the interview

Interview prep

Questions that come up in real DevOps interviews, with the kind of answer that lands. Say yours out loud first, then compare. Each one links to the chapter that goes deeper.

    Private to you

    My notes

    Everything you wrote down while watching and reading, in one place. Saved to your account, never shown to anyone.