Skip to main content
PRACTICE / PROGRAMMING / PYTHON 02

Expressions & Interactive Input

Eight beginner coding challenges: arithmetic, operator precedence, floor division, conversion and real Python input() responses.

8 coding challengesReal PythonOptional hintsIndependent builds

How it works: Read the requirement, predict the result, and write real Python. When a task uses input(), provide one response per line in the Program Input panel. Run tries your chosen values; Check uses the task's stated sample and additional scenario checks when included. No account or installation is required.

Review the lesson →
JOELEARNS / PYTHON WORKBENCH

Write it. Run it. Understand it.

Learn arithmetic, operator precedence and real Python input() with a controlled text-input panel.

Python 3.14 · in-browser
CHALLENGE 01 / 8 · BEGINNER

Calculate connected ports

Northstar has three switches with eight connected ports each and two spare ports. Calculate total_ports using multiplication and addition, then print exactly '26 ports total'. Use the given values rather than writing the answer directly.

EXPECTED OUTPUT26 ports total
script.py editableCtrl / Cmd + Enter to run
Your code is stored only in session storage when enabled. Never paste secrets. Clearing this option clears saved drafts, not the editor.
Code executes only when you choose Run or Check. No account needed.
HINTS · OPTIONAL

Try solving it before asking for help. Hints never show a completed program.

PYTHON OUTPUTReady

Your printed output and errors will appear here.

VARIABLE TRACER

Run the code, then step through the executed lines to watch variable values change.

About this environment: The Python runtime is loaded on demand from a version-pinned CDN and runs inside a sandboxed, opaque-origin browser frame. Runs have a time limit. OS/network automation is outside this introductory workbench. If your code calls input(), a response panel appears to supply text to those calls. Don't paste secrets or untrusted scripts.