A file does not echo values
In the REPL, the line 2 + 3 would show 5. In a program it calculates 5 and throws it away. Only print shows things.
Typing python with no file name opens the interactive shell, where Python runs each line as soon as you press Enter and shows the result. It is the fastest way to try an idea, check how something behaves, or use Python as a calculator.
Change the code and press Run (Ctrl+Enter). Predict what will happen first, then break it on purpose and read what changes. Your edits are saved and match the lesson page.
Ready for more? This phase has 5 hands-on exercises with automatic checks.
Practice questions
Write the code in the editor, run it, then open the model answer to compare.
A file contains the two lines 100 / 8 and print(100 / 8). What does running it print?
Write a program that prints both the reader's view and the programmer's view of the text 42.
You see this in documentation: >>> len("hello") followed by 5. Write the line you would put in a file to see the same answer.
Explain it without notes
What does REPL stand for, and what happens at each step?
Why does typing 2 + 3 show 5 in the REPL but nothing when it is a line in a file?
In the REPL, why does name show 'Asha' with quotes while print(name) shows Asha without?
When would you use the REPL and when a file?
Expected output
5
this is shown