Hafeezul Kareem has Published 257 Articles

Calculating Wind Chill Factor(WCF) or Wind Chill Index(WCI) in Python Program

Hafeezul Kareem

Hafeezul Kareem

Updated on 24-Apr-2020 12:40:14

566 Views

In this tutorial, we are going to learn how to calculate Wind Chill Index in Python. We have the formula to calculate the WCI and it's straightforward. We are going to use the following formula to calculate the WCI.Twc(WCI) = 13.12 + 0.6215Ta – 11.37v+0.16 + 0.3965Tav+0.16whereTwc = Wind Chill Index ... Read More

Lambda expression in Python Program to rearrange positive and negative numbers

Hafeezul Kareem

Hafeezul Kareem

Updated on 24-Apr-2020 12:34:21

845 Views

In this tutorial, we are going to write an anonymous function using lambda to rearrange positive and negative number in a list. We need the pick the negative numbers and then positive numbers from a list to create a new one.AlgorithmLet's see how to solve the problem step by step.1. ... Read More

Python Dictionary Comprehension

Hafeezul Kareem

Hafeezul Kareem

Updated on 24-Apr-2020 12:26:13

478 Views

In this tutorial, we are going to learn how to use dictionary comprehensions in Python. If you are already familiar with list comprehension, then it won't take much time to learn dictionary comprehensions.We need the key: value pairs to create a dictionary. How to get these key-value pairs using dictionary ... Read More

Program to print its script name as output in Python

Hafeezul Kareem

Hafeezul Kareem

Updated on 24-Apr-2020 12:20:22

1K+ Views

In this tutorial, we are going to write a program that prints the name of the Python script file. We can find the script name using the sys module.The sys module will store all the command line arguments of python command in the sys.argv list. The first element in the ... Read More

Writing files in the background in Python

Hafeezul Kareem

Hafeezul Kareem

Updated on 12-Feb-2020 13:01:33

616 Views

In this tutorial, we will learn about the multi-threading in Python. It helps us to perform multiple tasks at a time. Python has a module called threading for multitasking.We see how it works by writing data to a file in the background while calculating the sum of elements in a ... Read More

Sum 2D array in Python using map() function

Hafeezul Kareem

Hafeezul Kareem

Updated on 12-Feb-2020 12:54:03

5K+ Views

In this tutorial, we are going to find the sum of a 2D array using map function in Python.The map function takes two arguments i.e., function and iterable. It passes every element of the iterable to the function and stores the result in map object. We can covert the map ... Read More

Run Length Encoding in Python

Hafeezul Kareem

Hafeezul Kareem

Updated on 12-Feb-2020 12:40:49

2K+ Views

In this tutorial, we are going to learn how to create a run-length encoding in Python. Given a string return a new string containing char and frequency.For example, the string tutorialspoint will be encoded as t3u1o2r1i2a1l1s1p1n1. The order is every char+frequency. Join all of them and return. See the steps ... Read More

Print a Calendar in Python

Hafeezul Kareem

Hafeezul Kareem

Updated on 12-Feb-2020 12:21:27

13K+ Views

In this tutorial, we are going to learn how to print the calendar of month and year using the calendar module of Python. It's a straightforward thing in Python. We need year and month numbers. That's it.Let's see how to print a year calendar. Follow the below steps to print ... Read More

Get a google map image of specified location using Google Static Maps API in Python

Hafeezul Kareem

Hafeezul Kareem

Updated on 12-Feb-2020 11:29:57

4K+ Views

Google provides a static maps API that returns a map image on our HTTP request. We can directly request for a map image with different parameters based on our need.We have to create a billing account on Google to use this API. You can go to the website for more ... Read More

Find current weather of any city using OpenWeatherMap API in Python

Hafeezul Kareem

Hafeezul Kareem

Updated on 12-Feb-2020 11:25:39

9K+ Views

In this tutorial, we are going to get the weather of a city using OpenWeatherMap API. To use the OpenWeatherMap API, we have to get the API key. We will get it by creating an account on their website.Create an account and get your API Key. It's free until 60 calls ... Read More

Advertisements