Hello world!
[vocab] shell | output | string | operator
→ Click here for instructions
[python used]
print()
function\n
string literal+
,-
,*
,/
,**
operators
Running commands in IDLE!
IDLE is a development environment for Python. It has two main window types, the Shell window and the Editor window. For this example, we will be using the Shell window.
1. Search for “IDLE” in the Start Menu & click to open it:
This opens a Python shell. A shell is any program that lets you enter commands and then executes those commands. In a Python shell, you can only run Python commands.
You know you’re in a Python shell when the prompt looks like this: >>>
. The prompt automatically appears when the shell is ready to accept commands.
2. Type a command, then press Enter/Return to run it
When you run a command, any output (what the computer returns) will appear on the next line, like this:
>>> print("Hello world!")
Hello World!
You don’t need to type >>>
(the prompt). It automatically appears when the shell is ready to accept commands.
Fun fact: Printing Hello world! to the screen as your first program in a new language is considered good luck ~(˘▾˘)~
One more thing: Values in quotes are called strings. “Hello world!” is a string.
3. Now let’s do some math. Python is very good at math…
- Add:
2 + 3
- Subtract:
5 — 1
- Multiply:
2 * 3
- Divide:
40 / 2
- Exponent:
2 ** 3
(2 to the power of 3)
+
, -
, *
, /
, and **
are basic operators.