PYTHON BUILD-IN FUNCTIONS

LEN() Len function take an iterable object and returns the numbers of items in an object. Example: >>items = [1,2,3,4] >>print(len(items)) Output :4 ZIP() Zip function can take nth iterable objects and return a zip object which is an iterator of tuples. Example: >>ids=[1,2,3] >>names=[‘a’,’b’,’c’] zipobj=zip(ids,names) print(list(z)) Output: [(1,’a’),(2,’b’)'(3,’c’)] ORD() Ord function return a number … Continue reading PYTHON BUILD-IN FUNCTIONS

SORTING ALGORITHMS IN PYTHON

INSERTION SORT Insertion sort algorithm places an unsorted element at its suitable place in each iteration and it’s suitable place in each iteration and it’s similar as we sort cards in our hand in a card game. It is efficient for smaller data sets, but very inefficient for larger lists. COMPLEXITY OF INSERTION SORT Time … Continue reading SORTING ALGORITHMS IN PYTHON

ROCK PAPER SCISSORS IN PYTHON

Rock Paper Scissors, a very famous game which you might have enjoyed with your friends but now it is the time to enjoy the same game using Python. Rock paper scissors is a hand game usually played between two people, in which each player simultaneously forms one of three shapes with an outstretched hand. These shapes are “rock”, … Continue reading ROCK PAPER SCISSORS IN PYTHON

COLLECTION MODULE IN PYTHON

The Python Collection module is defined as a container that is used to store collections of data, for example – list, dict, set, and tuple, etc. It was introduced to improve the functionalities of the built-in collection containers. Python collection module was first introduced in its 2.4 release. There are different types of collection modules … Continue reading COLLECTION MODULE IN PYTHON

MAGIC FUNCTIONS OF PYTHON

Have you ever heard about these three functions? map() filter() reduce() It is a part of functional programming. I call these as ‘MAGICAL FUNCTIONS’ because we can save the time and write shorter code. map(func, *iterables) map functions take two arguments as input. The first one is a function and second one is iterable object. … Continue reading MAGIC FUNCTIONS OF PYTHON

TERMINOLOGIES

These are some of the terminologies you needed to understand the machine learning. model A mathematical representation of a real world process; a predictive model forecasts a future outcome based on past behaviors. training The process of creating a model from the training data. The data is fed into the training algorithm, which learn a … Continue reading TERMINOLOGIES

POST A PICTURE USING A BOT IN PYTHON

How to post a picture on Instagram automatically using bot in python? STEP 1: Install ‘Instabot’ package using the below command. pip install instabot STEP 2: Import class ‘Bot’ from ‘Instabot’ package. Command: from instabot import Bot STEP 3: Create a variable let’s say ‘bot’ and store the class ‘Bot’ in it. Command: bot=Bot() STEP … Continue reading POST A PICTURE USING A BOT IN PYTHON

GENERATORS IN PYTHON

A generator in Python is a function which returns an iterable object. We can iterate on the generator object using the “yield” keyword. But we can only do that once because their values don’t persist in memory, they get their values on the fly. Generators give us the ability to hold the execution of a … Continue reading GENERATORS IN PYTHON

PERKS ABOUT DJANGO

WHAT IS DJANGO? Django is a high level Python Web framework that encourages rapid development and clean, pragmatic design. It is a free and open source web application framework. WHERE DID DJANGO COME FROM? It is developed from a online news operation. It’s primary goal is to “ease the creation of complex, database-driven websites” It … Continue reading PERKS ABOUT DJANGO

Design a site like this with WordPress.com
Get started