## Introduction to Ethereum’s Gas in Solidity Development

This article explains the concept of gas in Ethereum and the basics you need to know when developing smart contracts in Solidity. What is Gas in Ethereum? In Ethereum, we have to pay for each computational operation, measured in the unit called gas. In the Ethereum documentation, gas is defined as follows: “Gas refers to … Read more

## Python __imod__() Magic Method

Syntax object.__imod__(self, other) The Python __imod__() magic method implements the in-place modulo operation x %= y that calculates the modulo operation x % y, and assigns the result to the first operands variable x. This type of in-place operation is also called augmented arithmetic assignment. The method simply returns the new value to be assigned … Read more

## Python dict.fromkeys() Method

The method dict.fromkeys() is a very useful method for creating new dictionaries from a given iterable of keys. Definition: dict.fromkeys() is a method that inputs keys and maybe an optional value, and outputs a dictionary with the specified keys, that are mapped either to optionally specified values or to the default None value. dict.fromkeys() Syntax … Read more

## Python __ifloordiv__() Magic Method

Syntax object.__ifloordiv__(self, other) The Python __ifloordiv__() magic method implements the in-place floor division operation x //= y that calculates the integer division operation x // y, and assigns the result to the first operands variable x. This operation is also called augmented arithmetic assignment. The method simply returns the new value to be assigned to … Read more

## What is The Difference Between remove(), pop() and del in Lists in Python?

[toc] remove(), pop() and del can all be used to delete items from the list in Python. However, there are some underlying differences between these three functions with respect to the way they operate, error modes, and computational complexities. Let us try to understand the differences between the three and when to use them. remove() … Read more

## How to Delete a File or Folder in Python?

[toc] There are various modules that can be easily used to delete a file or folder in Python. In this article, we are going to look at the various methods used to delete a file or folder in Python.  Method 1: The os module A Quick Recap to the OS Module:The OS module is a … Read more

## How to Print Tab-Separated Values of a Python List?

[toc] Problem Statement: How to separate the items of a list in Python using tab as the delimiter? Example: The following example demonstrates an example of the given problem statement. The problem is self-explanatory. Hence, without wasting too much time, let’s dive into the various ways of solving this problem. Method 1: Using Escape Sequence … Read more

## How to Fix “Import error: No module named urllib2” in Python?

Problem Statement: How to fix the Python error – “Import error: No module named urllib2” ? A Gentle Introduction URL stands for Uniform Resource Locator. Basically, URL is used to identify a resource on the internet. In order to fetch an URL from the internet and use the data within the URL, the urllib2 standard … Read more

## Find The Full Path of The Python Interpreter

[toc] Introduction Problem Statement: How to find the full path of the currently running Python interpreter? There are different ways to find the full path of Python interpreters. But first, let’s get the basics out of our way before we unearth the solution to our problem statement. So, what’s a Python Interpreter? This might be … Read more

## Python Pandas melt()

Syntax pandas.melt(frame, id_vars=None, value_vars=None, var_name=None, value_name=’value’, col_level=None, ignore_index=True) Return Value The return value for the melt() function is an unpivoted DataFrame. Background Direct quote from the Pandas Documentation website: “This function massages a DataFrame into a format where one or more columns are identifier variables (id_vars). While all other columns are considered measured variables (value_vars), … Read more

## Python __itruediv__() Magic Method

Syntax object.__itruediv__(self, other) The Python __itruediv__() magic method implements the in-place division operation x /= y that calculates the division operation x / y, and assigns the result to the first operands variable x. This operation is also called augmented arithmetic assignment. The method simply returns the new value to be assigned to the first … Read more

## How Do I Copy a File in Python?

File handling can be a tricky area to deal with while you are scripting in Python. There are numerous occasions wherein we need to work with files and folders from within the Python script. Thus, Python facilitates us with numerous file operations that makes life easier for us when we come across such situations. One … Read more