import time
import logging
import multiprocessing
def sleep_5_seconds():
logging.info(' Will sleep 5 seconds')
time.sleep(5)
logging.info(' Done sleeping 5 seconds')
def sleep_10_seconds():
logging.info(' Will sleep 10 seconds')
time.sleep(10)
logging.info(' Done sleeping 10 seconds')
def main():
logging.basicConfig(level = logging.INFO)
PROCESS1 = multiprocessing.Process(target = sleep_5_seconds)
PROCESS2 = multiprocessing.Process(target = sleep_10_seconds)
PROCESS1.start()
PROCESS2.start()
main()OUTPUT:
INFO:root: Will sleep 5 seconds
INFO:root: Will sleep 10 seconds
After 5 seconds
INFO:root: Done sleeping 5 seconds
After another 5 seconds
INFO:root: Done sleeping 10 seconds

Sometimes, we might be in a situation where we have to send emails to multiple people in a personalised manner (like mailing each student their grades, mailing bank statements to customers, etc.). Although these emails follow the same format, the information inside it varies from receiver to receiver. When done manually, it is time-consuming and there is a lot of room for error. Python allows us to automate this process very easily, let’s see how it’s done.

For this, you will need:

1.A Gmail account for development

2. template.txt file — containing the format for the email body

3. details.csv…


Almost every interview for coding and software development roles is incomplete without a programming interview. There are thousands of questions in coding sites like LeetCode and it is impossible to cover all the topics within a short period.

In this series, I will provide solutions to frequently asked interview questions under major topics such as arrays, linked lists, trees, dynamic programming etc.

Photo by Headway on Unsplash

Find the duplicate in an array of N integers

Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must exist. …


“When was the last time you tried a coding challenge?”

“I tried it just yesterday and it’s way out of my league. I’m just a beginner.” said the apprentice.

“About a year ago, when I began learning about stacks, trees and heaps. Now, I’m all caught building websites.” said the experienced.

“I can’t even remember. I’m not trying to win any coding competition here.” said the expert.

I’m here to tell you why they all are wrong.

The apprentice

Learning a programming language by doing online courses is a no-brainer. But coding is a skill and just like other any skill, you…


Photo by Glenn Carstens-Peters on Unsplash

Netflix began its journey to becoming the world’s biggest streaming service in 1997.

Initially, Netflix offered DVD sales and rental by mail. In 2007, Netflix began its streaming media services as the world’s first online DVD rental store with 925 titles. Netflix went from being a bit of luxury in 2007 to what it is today, a near necessity with rights to almost 14,000 titles in 190 countries.

Exploring the Netflix dataset

Let us examine the Movies and TV Shows listings on Netflix Dataset — This dataset consists of TV shows and movies available on Netflix.

#import pandas as pddf = pd.read_csv("../1_netflix/data/netflix_titles.csv",index_col='title')##…

Madhumitha Kannan

I’m a Computer Science Undergrad on a quest to innovate and build stuff with code. Find all my posts at https://madhumithakannan.github.io/blog

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store