Interacting with Console

Deepak Singhal
2 min readOct 5, 2022

--

Prerequisites: Python installed on any (Linux, Mac or Windows) machine.

Previous: Components of Program

Image credit: Google

We will learn more about console first,

Every environment has a console, i.e. a chalkboard, to interact (communicate) with the ones who are present in that environment. One such example of an environment is a Class of students.

Computer also has its own environment and hence has its own console (chalkboard). They are as follows:

  • Windows: PowerShell/cmd
  • Linux/Mac: Terminal

Since every environment is different, like environment of a Hindi class differs with English class, their consoles also understand different languages. Thus, PowerShell/cmd accepts different language than terminal of Linux or Mac.

We will begin by opening any console of computer. Type python and hit enter. This will launch the console for python environment. (If it doesn’t python is not installed properly)

python is a word which console understands, and it means that it should launch a console which understands python. Hitting enter means do it/ execute this command. (By executing this command, it is then translated by the compiler/interpreter of the environment into the language accepted by the computer)

Python console will look like this:

Python console

Writing to console

“We need chalk to write on the chalkboard”. Chalk here refers to the language.

Type print("Hello world!!!") and press enter. What do you see?

Computer wrote something on the console for you, right?

Congratulations !! You have written your first program

A program to write “Hello world!!!” on the console.

Next: Teardown of our first program

--

--