JSON in few words JSON (i.e. JavaScript Object Notation) syntax is based on a subset of the JavaScript programming language. It is a simple, easy to read, write, parse and transform data exchange format. JSON is extremely popular in building REST based web services. Recall that not only JSON but also other formats such as
Table of contents Introduction Playing cards Playing cards four of a kind Playing cards one ace in each hand Probability of selecting marbles Probability of selecting two balls of the same color Forming a team Color signals California license plate numbers Computer language symbols Men and women Cars and drivers Defective antennas Car parking Random
Table of contents Recursive exponential Recursive max Recursive multiplication Recursive sum Recursive average Recursive uppercase Recursive exponential Given two exponential numbers with the same base, the multiplication is another exponential number with the same base but we add the exponents. We can utilize this observation and define a recursive exponential formula. If (n) is even
Introduction Have you heard of Yelp before ? Probably yes, it is a crowd sourced review local search service. Today, we are going to demonstrate Yelp’s open API using Python. We are going to implement a simple Python script to search for a business, get its rating, address and phone number. Our script utilizes Yelp
Table of contents Circular linked list Linked list nth node from the end Reverse linked list Reverse linked list recursively Circular linked list This is a typical interview question. Given a singly linked list. Write a function that detects if the linked list is circular (has a loop) which means the last node points to
Introduction Buying and selling domain names is fun and can be rewarding at the same time, specially if we manage to generate a unique domain name that could sell for a fortune. Getting rich overnight is not our topic today, however we are going to discuss how can we automate checking domain name availability using
Introduction There are various ways to implement a minimal Python web service or server. It can be easily implemented using the web.py python web framework. First, you need to install the library. Open a terminal and execute the following command… Provide the password when requested. If the installation goes smoothly, create a Python script and
Introduction So you got a text file with duplicates (words, lines, etc) and you want to delete the extra ones ? How can we do that ? This post discusses a couple of methods that can be used to remove duplicates via Unix (or Mac) terminal. Assume we have the following text file… Let us
Introduction In Python, this question can be tricky specially if you come from a C++ background where pass by value and pass by reference is well defined. So what does that mean in Python? This question is repeatedly asked and answered online. My take on that is through the following example… Define 4 data types
What is PIP PIP (stands for PIP Installs Packages) is a command line utility to manage (ex. install, uninstall, etc) Python packages. Depending on which Python version, you may or may not have it installed. Newer versions of Python already ship with PIP. If you do not have it installed, follow the steps below… Check