Python Environment

Learn to Code Today!

Learn 10x faster: coding, no-code and data skills. Join millions of users mastering new tech skills and accelerating their career with Enki.
Get started

This is part of “An intro to Python” series of posts, with content from the Enki app. If you stumbled upon this, you can start from the beginning.

Python comes pre-installed on most operating systems. It can also be downloaded online for free.

Once installed, you can type python3, python or python -i to run the Python interpreter¹ from the shell²:

This gives you a local interactive environment where you can run Python code and output the results.

The Python interpreter is your playground. So test things, go crazy!

It is the ideal place for testing out small pieces of code or calculations.

For example:

For anything longer than a few lines of code, it’s much easier to use a text editor.

Some of the most popular text editors are Notepad, Atom, VIM, Sublime Text and Visual Studio Code.

We recommend Visual Studio Code for beginners.

Once you’re using a text editor you can save files using a .py extension and then open them from the shell by running:

Hello World!

Let’s write our first Python program, and print Hello World! to our screen!

To do this, in the Python interpreter, use Python’s print function as follows:

The output displayed in the shell is:

In this program, we’ve used Python’s built-in print function. Soon you’ll learn about many more of these built-in functions and how to create your own.

Footnotes

[1] The Python interpreter is the application that runs your Python script.

The interpreter is a quick way to explore Python and try out code without creating a file. It is a Read-Eval-Print Loop, or REPL, a tool offered by many modern programming languages.

To use it, you launch the Python interpreter with python3, python or python -i and type your Python code at the prompt. The interpreter evaluates the code you type and displays the results.

[2] The shell, also known as the command line, is a program which processes shell scripts, like Bash. Shell scripts allow you to manipulate and navigate between files, execute programs, and print text. The shell is run through the terminal.

Learn More

About Enki

  • Fully personalized online up-skilling
  • Unlimited AI coaching
  • Designed by Silicon Valley experts

More articles

Meet your AI-enabled coach

Professional athletes have a coach for every aspect of their performance. Why can’t you for your work? Enki’s AI-powered coaching on-demand - combined with state of the art, structured learning content - makes this a reality.
1
1:1 AI Coaching
How do I remove duplicate emails?
Convert the list to a set and back to a list. Sets automatically remove duplicates.
2
Personalized Exercises
3
Interactive practice

Unlock full access to all skills on Enki with a 7-day free trial

Get started