Source Code
For a text-based language, source code contains the program’s instructions; a language tool gives them meaning.
Understand the idea
In a text-based language such as Python, source code is text written using the language’s rules. A saved source file is not the same thing as a running program. A language tool must process it. Different languages use different execution steps; this small example uses Python 3 and does not claim that every language runs the same way.
The line print("Hello, human!") asks Python to display a string. The quotation marks identify the string in the source. They are not part of the displayed greeting. Keep ordinary straight quotation marks when typing this example; a word processor can substitute characters that are not the intended Python syntax.
You may see >>> at the start of examples in the Python interactive interpreter. That is the interpreter’s prompt, not a line to add to hello.py. For the source file in this example, save only the print() call. The next lesson connects that saved file to a command that runs it.
Key points
- 01 Source code in this Python example is text that follows the language’s syntax.
- 02 A saved source file is different from a running program.
- 03 This example is specifically Python 3.
- 04 print displays the supplied string without its enclosing quotation marks.
- 05 Interactive prompt markers do not belong in the saved source file.
Worked example
Predict a line of Python
A worked example using sample data. Nothing here runs on your computer.
print("Hello, human!")Hello, human!This is the expected output when Python executes the line. Displaying or saving the source alone does not execute it. print also writes a final newline.
Visual
flowchart LR S["Source: print() call"] --> P["Python interpreter"] P --> O["Output: Hello, human!"]
Follow the primary sources
An original HWTL explanation, prepared and independently checked with AI against the sources below. This lesson has not yet been tested with human learners.
Source review completed 2026-10-07.
- Python 3.13: An Informal Introduction to Python
Python strings, print output, and the distinction between interactive prompts and the text entered after them.
- Python 3.13: Using the Python Interpreter
The interpreter can read and execute a script from a supplied filename.
Practice · predict the result
Predict the string, not the source spelling
A small test from your robot instructors. Hints are welcome.
What you will practice: Predict the displayed text of a one-line Python source file and separate source syntax from output.
Sample scenario. Synthetic file containing only the shown print call with a simple literal string. Python 3 is available. Every listed output line ends with a newline. No interactive prompt is part of the source.
- Saved Python 3 source
print("Hello, patient human!")- Action
An available Python 3 interpreter reads this saved file.
When Python 3 reads this saved one-line file, which line is displayed?
Attempts stay on this browser and are kept separate from lesson views and your self-reported knowledge.
Sources and exercise scope
- Python 3.13: An Informal Introduction to Python
print displays a string without its enclosing source quotation marks; interactive prompts are distinct from entered source.
- Python 3.13: Using the Python Interpreter
Interpreter command discovery depends on the installation; a supplied filename identifies the script read by the interpreter.
Original synthetic exercise, checked with AI against primary documentation on 2026-10-08. Human learner validation is pending. A result here records this attempt; it does not establish mastery.
Make this lesson yours
Save it for later, or tell your robot what would help.
This correction stays on this browser. Browse all concepts if the topic is missing.
Familiarity is your own assessment. To use it in your coding tool, download your updated learning profile.
Choices are saved on this browser. They do not sync to your account or coding tool.
Lesson diagnostics
Download the public lesson material, resource choices, and robot text selected for this page. The file does not include your chat, code, or saved profile. Nothing from the trace is uploaded.
It records the page’s selections, not video playback or proof of learning. A link from your coding tool does not supply its original recommendation trace.
Enable JavaScript to create a trace on this device.