Page 64 - KEC Khaitan C7 Flipbook
P. 64
Libraries and Tools: Programming in Python is easier because the libraries and supporting
tools make even a complicated task easy.
Interpreted: The interpreted language allows for easy debugging as it executes code line by line.
Integrated and Extensible language: We can easily integrate Python with other languages
such as C, C++. We can also write and compile a Python code in C or C++.
Dynamic Memory Allocation: When an object is created in Python, memory is dynamically
allocated to it. This memory is also retracted when it is no longer being used.
Object-Oriented: Python has an object-oriented approach. This means that the programs are
designed using objects and classes that interact with each other.
PROGRAMMING MODES IN PYTHON
Python provides two basic programming modes: Interactive Mode and Script Mode.
INTERACTIVE MODE (IDLE SHELL WINDOW)
The IDLE Shell window is an interactive window where we can type a Python code and view the
output in the same window. In the IDLE Shell window, the >>> sign appears. Here, we can type our
code and get output by pressing the Enter key.
Short key To close IDLE window: Subject: To exit IDLE window
To exit the IDLE window, click on
Ctrl +
D
Exit option.
File menu
SCRIPT MODE (EDITOR’S WINDOW)
Python Shell executes commands immediately and doesn't save them for later use. For multi-
line code and to save your work for future use, you should use Python script mode. This allows
you to write larger programs and run the same code multiple times. Save your code in a file, for
example, 'filename.py', and run it to see all the output after execution. To open Python Editor’s
Window: click on the File menu click on the New File option.
62 Premium Edition-VII

