Meeting the Interpreter

1 minutes
Share the link to this page
Copied
  Completed

The Python interpreter processes text-based program code, and also has an interactive mode where you can test snippets of code and is useful for debugging code. Python’s interactive mode can be entered in a number of ways:

  • From a regular Command Prompt – simply enter the command python to produce the Python primary prompt
  • From the Start Menu – choose “IDLE” (Python GUI) to launch a Python

Irrespective of the method used to enter interactive mode, the Python interpreter will respond in the same way to commands entered at its >>> primary prompt.

In its simplest form, the interpreter can be used as a calculator.

Enter Python interactive mode, using any method outlined opposite, then type a simple addition and hit Return to see the interpreter print out the sum total.

The Python interpreter also understands expressions, so parentheses can be used to give higher precedence – the part of the expression enclosed within parentheses will be calculated first.

  Download

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.