Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Articles on Trending Technologies
Technical articles with clear explanations and examples
Python Get the real time currency exchange rate?
Python is excellent at handling API calls for retrieving real-time and historical currency exchange rates. This article demonstrates two primary methods: using the forex-python module and making direct API calls. Using forex-python Module The forex-python module provides the most direct way to get currency conversion rates. It offers simple functions that accept currency codes and return conversion rates. Real-time Exchange Rates Here's how to get live currency conversion rates ? from forex_python.converter import CurrencyRates c = CurrencyRates() # Get USD to GBP conversion rate rate = c.get_rate('USD', 'GBP') print(f"1 USD = {rate} ...
Read MorePython - Combine two lists by maintaining duplicates in first list
In data analysis using Python, we often need to combine two lists while handling duplicate elements carefully. This article shows how to combine two lists by maintaining all elements from the first list (including duplicates) and adding only unique elements from the second list. Using extend() with Generator Expression This approach preserves the original first list and uses a generator expression to filter unique elements from the second list ? # Given lists first_list = ['A', 'B', 'B', 'X'] second_list = ['B', 'X', 'Z', 'P'] # Create result list starting with first list result = ...
Read MorePython - Convert 1D list to 2D list of variable length
A list in Python is normally a 1D list where the elements are listed one after another. But in a 2D list we have lists nested inside the outer list. In this article we will see how to create a 2D list from a given 1D list with variable-length sublists based on specified lengths. Using Slicing with Index Tracking In this approach we will create a for loop to iterate through each required length and use slicing to extract the appropriate elements from the 1D list. We keep track of the current index position and increment it by ...
Read MoreHow to Change the Thickness of hr Tag using CSS?
The tag is used to draw horizontal lines on a web page. This tag is one of the most useful HTML tags for separating content by drawing a horizontal line between different sections. In this guide, we will learn how to change the thickness of an tag using CSS with different methods. Syntax hr { height: value; border: value; } The hr Tag in HTML The tag stands for horizontal rule. It is a self-closing tag that creates a visual divider between sections ...
Read MorePython - Convert a list of lists into tree-like dict
Given a nested list, we want to convert it to a dictionary whose elements represent a tree data structure. In this article, we will explore two approaches to transform a list of lists into a hierarchical dictionary structure. Using Simple Iteration and Slicing We reverse the items in each list using slicing and then build the tree structure by checking and adding keys at each level ? Example def create_tree(nested_list): new_tree = {} for list_item in nested_list: current_tree = ...
Read MoreThe impact of quick commerce on traditional grocery stores
In today's digital era, Quick Commerce has become the fastest process of delivering groceries in just 10 to 30 minutes. The growing demand for convenience and speed has wholly transformed the retail industry. This article explores the impact of Q-commerce on traditional grocery retail and what it means for the future of shopping. What is Quick Commerce? Quick Commerce (Q-commerce) refers to instant commerce, where customers can receive products or services within 10-30 minutes of placing an order. This model relies on hyperlocal delivery networks and strategically located micro-warehouses to fulfill orders at lightning speed. The Impact ...
Read MorePython - Check if k occurs atleast n times in a list
When analyzing data in Python lists, you often need to check if a specific element appears at least N times. For example, determining if the number 5 appears at least 3 times in a list. This article demonstrates three efficient approaches to solve this problem. Using Manual Counting The most straightforward approach is to iterate through the list and count occurrences of the target element ? data = [1, 3, 5, 5, 4, 5] print("Given list:", data) # Element to be checked elem = 5 # Minimum required occurrences n = 3 count = ...
Read MoreHow to add gradient borders in css?
Gradient borders add a modern and visually appealing touch to web elements, making them stand out. However, achieving this effect in CSS isn't straightforward because the border property doesn't natively support gradients. This article explores practical workarounds to implement gradient borders using three different methods. Syntax /* Method 1: Using border-image */ selector { border-width: 5px; border-style: solid; border-image: linear-gradient(direction, color1, color2) 1; } /* Method 2: Background and Padding */ .parent { background: linear-gradient(direction, color1, color2); ...
Read MorePygorithm module in Python
The Pygorithm module is an educational Python library containing implementations of various algorithms and data structures. Its primary purpose is to provide ready-to-use algorithm code for learning and practical applications in data processing. Installation Install Pygorithm using pip ? pip install pygorithm Finding Available Data Structures After installation, you can explore the various data structures included in the package ? from pygorithm import data_structures help(data_structures) The output shows all available data structures ? Help on package pygorithm.data_structures in pygorithm: NAME pygorithm.data_structures - Collection ...
Read MoreTic Tac Toe Game with HTML, CSS, and JavaScript
Tic Tac Toe is a well-known two-player board game where players take turns placing their marks (X or O) on a 3x3 grid. The first player to get three marks in a row horizontally, vertically, or diagonally wins. If all cells are filled without a winner, the game ends in a draw. In this article, we will build a complete Tic Tac Toe game using HTML, CSS, and JavaScript. The game includes features like reset, undo, sound effects, and a responsive design. Game Features HTML Structure − Creates a 3x3 grid using div elements where each ...
Read More