Python Basics: Module & Namespace

A module in Python is a Python source file that contains definitions and use them in a script or in an interactive instance of the interpreter.
We use modules to divide a piece of software into separate but cooperating parts.
Continue reading “Python Basics: Module & Namespace”

To Compare Float, Double, or Long Data Types

A way to make doubles, floats, or longs ‘equal’.

Float a=1.56148; Float b=1.56139;
  Float threshold = 0.00009 or 0.0001 //difference of Float a and Float b
  if (Math.abs(a-b) <= threshold){//Or < threshold
     //logic here
  }

Continue reading “To Compare Float, Double, or Long Data Types”

Python Basics: Immutable Sequence Type & Tuples 1

Sequence type: a data type in Python which is able to store more than one value or less than one value (as a sequence my be empty), and these values can be sequentially browsed element by element (like a list).

Mutability: a property of any of Python’s data that describes its readiness to be freely changed during program execution.
Continue reading “Python Basics: Immutable Sequence Type & Tuples 1”