2020 Chapter 007 Python Introduction
2020 Chapter 007 Python Introduction
Interactive
Mode
Python (Immedi
working ate
Ways Mode)
Script
Mode
The default installation of CPython
Interpreter,
comes Python IDLE
with and pip(package installer).
Python
To work in either interactive mode or script we need
to open Python IDLE
>>> ( >>>
prompt20 + ) (command give by
30
For e.g if you type 20 + 30 in from of IDLE
user)
prompt
50 the above example (output
From you given
can seeby than at
>>> we have to python) just give the command to
execute and python we execute it if it is error free
otherwise gives an error.
(
)
( )
)
)
(
(
(
)
print
(“Hello”)
Script Mode – multiple commands can be saved
in a file as a
program and then we can execute the entire
program
we type Python program in a file and then use the
interpreter to execute the content from the file.
Working in interactive mode is convenient for
beginners and for testing small pieces of code, as
we can test them immediately. But for coding
more than few lines, we should always save our
code so that we may modify and reuse the code
In Python IDLE :
Click File New
In new window type the commands you want to
save in program
For example:
print(“Hello World!”)