Samual Sam has Published 2310 Articles

What are the best practices for using loops in Python?

Samual Sam

Samual Sam

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

716 Views

This is a language agnostic question. Loops are there in almost every language and the same principles apply everywhere. You need to realize that compilers do most heavy lifting when it comes to loop optimization, but you as a programmer also need to keep your loops optimized.It is important to ... Read More

How to put multi-line comments inside a Python dict()?

Samual Sam

Samual Sam

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

376 Views

You can put comments like you normally would anywhere in a python script. But note that you can only put single line comments using #. Multiline comments act like strings and you cannot put just a string in between definition of a dict. For example, the following declaration is perfectly ... Read More

How to execute Python multi-line statements in the one-line at command-line?

Samual Sam

Samual Sam

Updated on 05-Mar-2020 08:08:02

2K+ Views

There are multiple ways in which you can use multiline statements in the command line in python. For example, bash supports multiline statements, which you can use like −Example$ python -c ' > a = True > if a: > print("a is true") > 'OutputThis will give the output −a ... Read More

Usage of :active pseudo-class in CSS

Samual Sam

Samual Sam

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

81 Views

The :active pseudo-class is used to add special style to an active element. Possible values could be any color name in any valid format.Example                    a:active {             color: #FF00CC;          }                     Click This Link    

CSS outline-style property

Samual Sam

Samual Sam

Updated on 04-Mar-2020 12:41:19

267 Views

The outline-style property specifies the style for the line that goes around an element. It can take one of the following values −none − No border. (Equivalent of outline-width:0;)solid − Outline is a single solid line.dotted − Outline is a series of dots.dashed − Outline is a series of short lines.double ... Read More

Absolute Positioning with CSS

Samual Sam

Samual Sam

Updated on 04-Mar-2020 12:36:00

806 Views

An element with position: absolute is positioned at the specified coordinates relative to your screen top-left corner.You can use two values top and left along with the position property to move an HTML element anywhere in the HTML document.Move Left - Use a negative value for left. Move Right - Use a positive value for left. Move ... Read More

Set the minimum width that a box can be with CSS

Samual Sam

Samual Sam

Updated on 04-Mar-2020 12:27:48

407 Views

The min-width property is used to set the minimum width that a box can be. The value of the min-width property can be a number, a length, or a percentage.Example                            This paragraph is 100px high and ... Read More

CSS width property

Samual Sam

Samual Sam

Updated on 04-Mar-2020 12:10:41

118 Views

The width property is used to set the width of a box. They can take values of a length, a percentage, or the keyword auto. You can try to run the following code to set width −Example                            This paragraph is 200pixels wide and 50 pixels high          

Set outline style as a groove with CSS

Samual Sam

Samual Sam

Updated on 04-Mar-2020 11:27:43

241 Views

To set the outline style as a groove, use the outline-style property with the value groove. Under groove, the outline looks as though it is carved into the page.− Example                            This text is having 3px groove outline.          

CSS outline property

Samual Sam

Samual Sam

Updated on 04-Mar-2020 11:23:34

142 Views

The outline property is a shorthand property that allows you to specify values for multiple properties such as color, style, width of outline. Example                            This text is having thin solid freen outline.                            This text is having thick dashed green outline.                      

Advertisements