Tag archives for python
Find the largest and smallest number in python using for loop
Write a python program to find the largest and smallest number in python using for loop Assign first element of an array to largest(lt) and smallest (st) value the array by using for loop If element of array a is smaller than first element of variable st then assign array…
Find two numbers whose sum is equal to a given number in sorted array
Find two numbers whose sum is equal to a given number in sorted array In order to find the sum of the two array elements you need to traverse in array and check the sum of each element. Let's take an example of below sorted array in which we have to perform below iteration to find the sum of the array element. First Iteration: 1 51 61 81 10 Second…
Bubble sort program in python
Write a Program in Python to execute Bubble sort program What is Bubble Sort Program ? Bubble sort is a simple sorting algorithm that compares adjacent elements and swaps them if they are in the wrong order. It will compares through the list until the list is completely sorted. Let's…
Program to print Fibonacci series in python
The Fibonacci numbers, commonly refers as Fibonacci sequence, in which each number is the sum of the two preceding numbers, starting from 0 and 1. The Fibonacci Sequence is the series of numbers: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, ... # Program to print Fibonacci sequence…
Reverse String in Python using Recursion
Let's understand what is the recursion in programming with reverse string in Python program Recursion is a process by which a function calls itself directly or indirectly. The corresponding function is called as recursive function When Should I use Recursion ? Recursion is made for solving problems that can be broken down into smaller,…
How to read a config file in Python
How to read a config file in Python: This article will help you to read config based on the environment. For example, If you have a python script which uses different database config for UAT and PROD. host = "" port = "12345" user = "PROD_SCHEMA" password = "Pwd1" service…
Python Script to Access Team Foundation Server (TFS) Rest API
I was working in a project where I have to access Team Foundation Server (TFS) Rest API in Python script. It was little bit tricky job to access TFS REST API from python 2 . Specially for beginners like me :) . I was facing issue to authenticate TFS REST…
Get File MIME Type in Python
Get file MIME type in Python You can get file mime type in python by using python-magic library. You can install python-magic using PIP. $ pip install python-magic To find mime type, import magic library and pass file path into () >>> import magic >>> ("path/", mime=True) 'application/pdf' If you…
Install Opencv in CentOS
What is OpenCV? OpenCV (Open Source Computer Vision Library) is an Open Source Library for computer vision, machine learning and image processing. You can use OpenCV with multiple programming languages like Python, Java, C++. OpenCV can be used to process the images, identify objects, face detection, real-time traffic monitoring, lane…





