At this point you have successfully installed Python on your computer using the Miniconda distribution. You're ready to run some Python code.
If you've programmed before, you may want to skip this and go straight to "Write your first Python program". If you're wondering what python code looks like, then read below.
The most basic way to write/run python code is using the python interpreter directly from Terminal/Command Prompt.
Type python
, to start the python interpreter
Type x = 1
and hit enter
x
and stored the integer 1
in that variable.Type y = 2
and hit enter
Type z = x + y
and hit enter
x = 1
and y = 2
, what does z
equal?To see what z
is now storing, type print(z)
and hit enter. Alternatively, you can just type z
and hit enter. Your terminal should now look like this:
You've run your first python code! See, not so scary. One thing you may notice is there's no way to save the code that you've just written.
In the next post, we'll cover a more realistic/useful way to write, save and execute python code.
Next post: Write your first Python program
Previous post: Install Python on your computer