Python
AN INTRODUCTION TO PYTHON
Different modes of Programming
Interactive mode :
We can write code in the Python Interpreter and it will give the results of
the commands.
Ex : > print(“Hello, World!”)
Script mode of programming :
We can also write Python scripts to get the desired results.
Note : Have the python Interpreter set in the PATH variable.
or use like
#! /usr/bin/python
print (“Hello, World!”)
Variables
Named storage locations.
Assignment happens through ‘=‘.
General naming convention is by using underscore between
names.
Data type are assigned dynamically by python based on the data
the variable holds.
Ex : a = 50
b = “The customer name is George”
The data type will be assigned automatically in each of the above
cases hence no explicit declarations are required.
Identifiers and rules for Identifiers
A Identifier is a name given to a variable, class, function, module or
other object.