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
Convert set into a list in Python
Converting a set into a list is a common task in Python data analysis. Since sets are unordered collections and lists are ordered, this conversion allows you to access elements by index and maintain a specific order. Using list() Function The most straightforward approach is using the built−in list() function, which directly converts a set into a list ? setA = {'Mon', 'day', '7pm'} # Given Set print("Given set:", setA) # Convert set to list result = list(setA) # Result print("Final list:", result) Given set: {'7pm', 'day', 'Mon'} Final list: ...
Read MoreDesign a Vertical and Horizontal menu using Pure CSS
The menu is a crucial component of any website. It helps visitors find content and directs them to key sections. CSS is excellent for creating stunning navigation menus that can be displayed either horizontally or vertically. In this article, we'll design vertical and horizontal menus using Pure CSS framework with HTML and tags. Syntax Pure CSS menu uses the following basic structure − .pure-menu { /* Base menu container */ } .pure-menu-horizontal { /* Horizontal layout modifier */ } .pure-menu-list { ...
Read MoreConvert number to list of integers in Python
Converting a number to a list of its individual digits is a common task in Python programming. This article explores two efficient approaches: list comprehension and the map() function with str(). Using List Comprehension List comprehension provides a concise way to convert each digit by first converting the number to a string, then iterating through each character and converting it back to an integer ? Example number = 1342 # Given number print("Given number:", number) # Convert to list of digits using list comprehension digits_list = [int(digit) for digit in str(number)] # ...
Read MoreDifferent ways to hide elements using CSS
There are instances when you simply don't want every element of your website to be exposed. In other words, you don't want every template element of a page, post, header, or footer displayed every time it appears. And while it might appear that you need to update the template or theme code each time you want this omission to happen, that's not actually true. In fact, with only CSS, you may rapidly hide parts of your website. And it's really not that difficult. Let's dive into the article for getting better understanding of the different ways to hide elements ...
Read MoreConvert list of tuples into digits in Python
Python has a wide variety of data manipulation capabilities. We have a scenario in which we are given a list which has elements which are pair of numbers as tuples. In this article we will see how to extract the unique digits from the elements of a list which are tuples. Using Regular Expression and Set We can use regular expression module and its function called sub. It is used to replace a string that matches a regular expression instead of perfect match. So we design a regular expression to convert the tuples into normal strings and then ...
Read MoreConvert list of strings and characters to list of characters in Python
When working with lists, we may come across a situation where we have to process a string and get its individual characters for further processing. In this article we will see various ways to convert a list of strings and characters to a list of individual characters. Using List Comprehension We design a nested loop using list comprehension to go through each element of the list and another loop inside this to pick each character from the element which is a string ? days = ['Mon', 'd', 'ay'] # Given list print("Given list :", days) ...
Read MoreHow to Create Image Accordion using HTML and CSS?
An image accordion is a popular web interface element that allows users to expand and collapse image sections for an interactive browsing experience. This technique creates a smooth, space-efficient way to display multiple images where only one section is fully visible at a time. Syntax .accordion-container { display: flex; } .accordion-item { flex: 1; transition: all 0.3s ease; cursor: pointer; } .accordion-item:hover { flex: expanded-ratio; } What is an Accordion? An accordion ...
Read MoreConvert dictionary object into string in Python
In Python data manipulation, you may need to convert a dictionary object into a string. This can be achieved using two main approaches: the built-in str() function and the json.dumps() method. Using str() The most straightforward method is to apply str() by passing the dictionary as a parameter. This preserves Python's dictionary representation with single quotes ? Example schedule = {"Mon": "2 pm", "Wed": "9 am", "Fri": "11 am"} print("Given dictionary:", schedule) print("Type:", type(schedule)) # Using str() result = str(schedule) print("Result as string:", result) print("Type of Result:", type(result)) The output of the ...
Read MoreConvert case of elements in a list of strings in Python
As part of data manipulation, we often need to standardize the case of strings in a list. In this article, we will see how to convert a list of string elements with mixed cases to a uniform case using Python's built-in string methods. Using lower() with map() The lower() function converts all characters in a string to lowercase. We can use map() with lambda to apply this function to each element in the list. Example days = ['MoN', 'TuE', 'FRI'] # Given list print("Given list:") print(days) # Convert to lowercase using map() and ...
Read MoreHow to create a CSS3 property for each corner?
CSS3 provides several methods to create custom corner styles for elements. This allows designers to move beyond simple rectangular shapes and create more visually appealing interfaces with unique corner treatments. Syntax /* Method 1: Border-radius */ border-radius: top-left top-right bottom-right bottom-left; /* Method 2: Individual corner properties */ border-top-left-radius: value; border-top-right-radius: value; border-bottom-right-radius: value; border-bottom-left-radius: value; /* Method 3: Clip-path */ clip-path: polygon(x1 y1, x2 y2, x3 y3, x4 y4); /* Method 4: Mask-image */ mask-image: gradient-function; Method 1: Using Border-radius Property The border-radius property allows you to specify different radius ...
Read More