Chandu yadav has Published 1091 Articles

Role of media attribute on the LINK element

Chandu yadav

Chandu yadav

Updated on 16-Mar-2020 07:14:04

147 Views

The media attribute on the LINK element specifies the target media of an external style sheet −Example    

Which element is used to add special style to the first letter of the text in a selector with CSS

Chandu yadav

Chandu yadav

Updated on 13-Mar-2020 13:04:04

110 Views

Use the :first-letter element to add special effects to the first letter of elements in the document. You can try to run the following code to add special styles to the first letter of text −ExampleLive Demo                    p:first-letter {   ... Read More

Java Program to Check if a String is Numeric

Chandu yadav

Chandu yadav

Updated on 13-Mar-2020 13:01:54

346 Views

ExampleYou can check if a given string is Numeric as shown in the following program.Live Demoimport java.util.Scanner; public class StringNumeric {    public static void main(String[] args) {       Scanner sc = new Scanner(System.in);       System.out.println("Enter a string ::");       String str = sc.next(); ... Read More

Java program to calculate mode in Java

Chandu yadav

Chandu yadav

Updated on 13-Mar-2020 10:54:18

16K+ Views

In statistics math, a mode is a value that occurs the highest numbers of time. For Example, assume a set of values 3, 5, 2, 7, 3. The mode of this value set is 3 as it appears more than any other number.Algorithm1.Take an integer set A of n values. ... Read More

Java program to implement linear search

Chandu yadav

Chandu yadav

Updated on 13-Mar-2020 05:51:22

7K+ Views

Linear search is a very simple search algorithm. In this type of search, a sequential search is done for all items one by one. Every item is checked and if a match is found then that particular item is returned, otherwise the search continues till the end of the data ... Read More

How to Find ASCII Value of Character using Python?

Chandu yadav

Chandu yadav

Updated on 05-Mar-2020 10:39:47

216 Views

The ord function in python gives the ordinal value of a character(ASCII). You can use this function to find the ascii codes as followsExamples = "Hello" for c in s:    print(ord(c))OutputThis will give the output72 101 108 108 111

How to check for redundant combinations in a Python dictionary?

Chandu yadav

Chandu yadav

Updated on 05-Mar-2020 07:09:45

157 Views

There will never be redundant combinations in a Python dictionary because it is a hashmap. This means that each key will have exactly one associated value with it. This value can be a list or another dict though. So if you try to add a duplicate key likeExamplea = {'foo': ... Read More

How to truncate Key Length in Python Dictionary?

Chandu yadav

Chandu yadav

Updated on 05-Mar-2020 07:00:13

675 Views

You can use a list comprehension to truncate keys in a python dict. Iterate over the keys in the dict, and create a new dict with the truncated keys. exampledef truncate_keys(a, length):    return dict((k[:length], v) for k, v in a.items()) a = {'foo': 125, 'bar': 'hello'} b = truncate_keys(a, 2) ... Read More

How to change the color of active links with CSS

Chandu yadav

Chandu yadav

Updated on 05-Mar-2020 04:59:07

5K+ Views

Use the :active class to change the color of active links. Possible values could be any color name in any valid format. ExampleYou can try to run the following code to implement the color of an active link −                    a:active {             color: #FF00CC          }                     My Link    

Usage of :link pseudo-class in CSS

Chandu yadav

Chandu yadav

Updated on 04-Mar-2020 12:38:51

94 Views

The :link pseudo-class is used to add special style to an unvisited link. Possible values could be any color name in any valid format. Example                    a:link { color:#000000; }                                Demo Link          

Advertisements