To see different mode of programming in python.
Interactive mode programming.
Invoking the interpreter without passing a script file as a parameter.
Scripting mode programming.
Invoking the interpreter without passing a script file as a parameter.
Python files have the extension .py. We should save the python file with .py extension.
#Type python3 on terminal
$ python3
Python 3.7.0 (default, Oct 9 2018,
10:31:47)
[GCC 7.3.0] :: Anaconda custom
(64-bit) on linux
Type "help", "copyright", "credits"
or "license" for more information.
# After getting >>>, we can type
our codes
>>> a=5
>>> b=10
>>> c=a+b
>>> print(c)
15
#First save the file with .py
extension
#Second we should specify the path of
file where its actually stored
#program code
a=5
b=10
c=a+b
print("The addition of a+b is:",c)