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
Articles by karthikeya Boyini
Page 91 of 143
Do you think Python Dictionary is really Mutable?
Yes, Python Dictionary is mutable. Changing references to keys doesn't lead to the creation of new dictionaries. Rather it updates the current dictionary in place. examplea = {'foo': 1, 'bar': 12} b = a b['foo'] = 20 print(a) print(b)OutputThis will give the output −{'foo': 20, 'bar': 12} {'foo': 20, 'bar': 12}
Read MoreHow can we combine multiple print statements per line in Python?
You can combine multiple print statements per line using, in Python 2 and use the end argument to print function in Python 3.examplePython2.x print "Hello", print " world" Python3.x print ("Hello", end='') print (" world")OutputThis will give the output −Hello worldAnother thing you could do is put all the things in an array and call ''.join(array). examplearr = ["Hello", "world"] print(' '.join(arr))OutputThis will give the output −Hello world
Read MoreHow to change the color of focused links with CSS
Use the :focus class to change the color of focused 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 the focused link − a:focus { color: #0000FF } This is demo link
Read MoreUsage of :first-child pseudo-class in CSS
Use the :first-child pseudo class to add special style to an element that is the first child of some other element.ExampleYou can try to run the following code to understand the usage of :first-child pseudo class − div > p:first-child { text-indent: 25px; } First paragraph in div. This paragraph will be indented Second paragraph in div. This paragraph will not be indented But it will not match the paragraph in this HTML: Heading The first paragraph inside the div. This paragraph will not be effected.
Read MoreUsage of :visited pseudo-class in CSS
The :visited pseudo-class is used to add special style to a visited link. Possible values could be any color name in any valid format. Example a:visited { color: #006600 } Click this link
Read MoreUsing CSS z-index property
The z-index property is used along with the position property to create an effect of layers. You can specify which element should come on top and which element should come at the bottom. ExampleYou can try to run the following code to implement the z-index property −
Read MoreWhat to do when an element's content might be larger than the amount of space allocated to it?
Use the CSS overflow property to solve this issue of a content exceeding the allocated space. You can try to run the following code to solve the issue −Example .scroll{ display:block; border: 2px solid green; padding:10px; margin-top:10px; width:300px; height:50px; overflow:scroll; } .auto{ display:block; border: 2px solid green; ...
Read MoreCSS line-height property
The line-height property is used to set the height of a line of text. The value of the line-height property can be a number, a length, or a percentage.Example This paragraph is 300 pixels wide and 100 pixels high and here line height is 50 pixels.
Read MoreSet outline style as a solid single line with CSS
To set the outline style as a solid single line, use the outline-style property with the value solid −Example This text is having 3px solid outline.
Read MoreHTML5 Canvas layer disappears on mouse click in Fabric.js and Firefox stops responding when creating a canvas for the image?
If the HTML5 Canvas layer disappears on mouse click in Fabric.js and Firefox stops responding when creating a canvas to the image, then there is a way to drag and drop images from your computer to canvas using Fabric.This can be done by making image draggable property to true by this way −
Read More