To execute statement/s multiple times, loops are used. Python loops: Python While Loop Python For Loop Python Nested Loops While Loop Condition is tested before executing the loop body. The condition may be any expression, and any non-zero value is considered as true The loop iterates while the condition is true When the condition becomes false, program control passes to …
Python Chapter#4: If-else
In Python: Any non-zero and non-null values are considered as TRUE, and Zero or NULL are considered as FALSE value Python has 3 types of decision/if-else statements as: Statement Description Syntax if An if statement consists of a boolean expression followed by one or more statements. Ex:Boolean expression: (x>y) if expression: statement(s) if…else An if statement can be followed by …
Python Chapter#2: Variable Types
A variable is associated with pair of a storage location and associated symbolic name (an identifier), i.e. [location,identifier]. Location is used by system and identifier is used by user/programmer to access the variable When a variable is created, some space in memory is reserved Data type of a variable decides, the amount of reserved memory and what can be stored …
Python Chapter#1: Getting Started with basic syntax
In python there are two modes available to program as Matlab: Interactive Mode Programming Script Mode Programming Now let’s see how to program in these modes: Interactive Mode Programming Python instructions can be directly executed from the python prompt. Ex: Ex: Ex: Script Mode Programming Similar to m file in matlab, python also provides facility to write program in a …
Set environment variables in windows
While working with java or python many of the times we may come across error of “command not found” while executing command in cmd, even after proper installation of the software. For python while trying to install a package through command prompt (cmd) following error may be faced: This error can be recovered by adding the path of python to …
Installing Python 2.7 with OpenCV on windows for Image Processing
For Image processing Python with OpenCV library is widely used. OpenCV provides a vast list of Image Processing techniques (like Enhancement, Segmentation, Feature extraction etc.). Along with “numpy” and “matplot” OpenCV provides easy and strong facilities for image processing. Follow these steps to install Python and OpenCV: Download Python 2.7.13 (Freeware) [32 bit/64 bit]. Install Python 2.7.13 on your system …