Five Simple Steps to Install Django in Ubuntu

Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design. Built by experienced developers, it takes care of much of the hassle of Web development, so you can focus on writing your app without needing to reinvent the wheel. It’s free and open source. In this blog post, i have … Continue reading Five Simple Steps to Install Django in Ubuntu

Which Version of Django Support what Version of Python ?

This small blog post is only published to make Django developers aware about Django-Python Versioning. Django VersionSupported Python Versions2.1, 2.23.5, 3.6,, 3.5, 3.6,, 3.4, 3.5, 3.6, 3.7 It is always recommended to use latest version of Django and it's supported Python versions. ** Django 1.11 will be the last version of Django to … Continue reading Which Version of Django Support what Version of Python ?

Top Django Interview Questions

  This time, i had compiled some Django Interview Questions.  This List might come handy to both Interviewer and Interviewee.  How do you create new project in Django ? How do you create new app in Django ? Explain MVT architecture of Django ? What are Middlewares ? How do you create custom Middleware ? What … Continue reading Top Django Interview Questions

How to Rename Remote GIT branch

If you had named a git branch incorrectly and had pushed the branch to remote repository. Follow the steps listed below to rename the remote branch: Rename the local branch.  If you are on the branch then, git branch -m <new-name> If you are not on the branch then, git branch -m <old-name> <new-name>    Delete … Continue reading How to Rename Remote GIT branch

How to send messages using Python

In this tutorial, we will learn to send message using Python. We can use this approach in building new Python applications. Tools we will be needing : Python - Version 2 or 3. Virtual Environment  - To create isolated Python environments Twilio Trial Account. Twilio Python helper library. Twilio API : We will be using Twilio … Continue reading How to send messages using Python

Balanced Parentheses Check | Python

Problem :  Given a string of opening and closing parentheses, check whether it’s balanced. We have 3 types of parentheses: round brackets: (), square brackets: [], and curly brackets: {}. Assume that the string doesn’t contain any other character than these, no spaces words or numbers. As a reminder, balanced parentheses require every opening parenthesis … Continue reading Balanced Parentheses Check | Python

Find the largest continuous sum | Python

Problem : Given an array of integers(positive and neg), Find the largest continuous sum . Solution :  def large_cont_sum(arr): if len(arr) < 1 : return 0 max_sum = current_sum = arr[0] for num in arr[1:]: current_sum = max(num,current_sum+num) max_sum = max(current_sum,max_sum) print max_sum large_cont_sum([1,2,-1,3,4,10,10,-10,-1]) #29

Linked List Nth to Last Node | Python

Problem : Function that takes a head node and an integer value n and then returns the nth to last node in the linked list. Solution :  class Node: def __init__(self, value): self.value = value self.nextnode = None def nth_to_last_node(n, head): node = head nodes = [] while node != None: nodes.append(node) node = node.nextnode return nodes[-n]

Recursive Binary Search | Python

Implement recursive binary search in Python def recursive_binary_search(arr,ele): if len(arr) == 0: return False else: mid = len(arr)/2 if arr[mid] == ele: return True else: if ele < arr[mid]: return recursive_binary_search(arr[:mid], ele) else: return recursive_binary_search(arr[mid+1:], ele) d = recursive_binary_search([1,2,3,4,5],22) print d

Binary Search | Python

Binary Search implementation in Python def binary_search(arr,ele): """ binary_search works only on sorted array, also it follows divide and conquer fundamentals """ first = 0 last = len(arr) - 1 # as indexing starts at 0 found = False while first <= last and not found: mid = (first+last)/2 # to get mid point of … Continue reading Binary Search | Python