CSS grid-area Property

usharani
Updated on 06-Jul-2020 11:14:34

117 Views

Set the grid-row-start, grid-column-start, grid-row-end and the grid-column-end properties using the grid-area property.ExampleYou can try to run the following code to implement the CSS grid-area property.LIve Demo                    .container {             display: grid;             background-color: green;             grid-template-columns: auto auto;             padding: 20px;             grid-gap: 10px;          }          .container > div {             background-color: orange;             text-align: center;             padding: 10px 0;             font-size: 20px;          }          .ele1 {             grid-area: 1 / 2 / 2 / 5;          }                     Game Board                1          2          3          4          5          6          

Set Flex Items Horizontally with CSS

varma
Updated on 06-Jul-2020 11:13:41

431 Views

Use the flex-direction property with row value to set the flex-items horizontally.ExampleYou can try to run the following code to implement the row value −Live Demo                    .mycontainer {             display: flex;             flex-direction: row;             background-color: #2C3E50;          }          .mycontainer > div {             background-color: #F7F9F9;             text-align: center;             line-height: 40px;             font-size: 25px;             width: 100px;             margin: 5px;          }                     Quiz                Q1          Q2          Q3          Q4          Q5          Q6          

Wrap Flex Items in Reverse Order with CSS

Chandu yadav
Updated on 06-Jul-2020 10:59:44

1K+ Views

Use the flex-wrap property with wrap-reverse value to wrap flex-items in reverse order.ExampleYou can try to run the following code to implement the wrap-reverse valueLive Demo                    .mycontainer {             display: flex;             background-color: #D35400;             flex-wrap: wrap-reverse;          }          .mycontainer > div {             background-color: white;             text-align: center;             line-height: 40px;             font-size: 25px;             width: 100px;             margin: 5px;          }                     Quiz                Ans1          Ans2          Ans3          Ans4          Ans5          Ans6          Ans7          Ans8          Ans9          

Animate CSS Column Gap Property

radhakrishna
Updated on 06-Jul-2020 10:54:42

570 Views

To implement animation on the column-gap property with CSS, you can try to run the following code −ExampleLive Demo                    div {             width: 600px;             height: 300px;             background: white;             border: 10px solid red;             animation: myanim 3s infinite;             bottom: 30px;             position: absolute;             column-count: 4; ... Read More

Group Elements at Same Indices in a Multi-List using Python

Hafeezul Kareem
Updated on 06-Jul-2020 09:40:01

693 Views

In this tutorial, we are going to write a program that combines elements of the same indices different lists into a single list. And there is one constraint here. All the lists must be of the same length. Let's see an example to understand it more clearly.Input[[1, 2, 3], [4, 5, 6], [7, 8, 9]]Output[[1, 4, 7], [2, 5, 8], [3, 6, 9]]We can solve it in different ways. Let's see how to solve with normal loops.Initialize the list with lists.Initialize an empty list.Initialize a variable index to 0.Iterate over the sub list length timesAppend an empty list to the ... Read More

Group Anagrams from Given List in Python

Hafeezul Kareem
Updated on 06-Jul-2020 09:37:28

4K+ Views

In this tutorial, we are going to write a program that groups all anagrams in a list. First, let's see what are anagrams.Any two strings that have the same character in a different order are known as anagrams.Before diving into the solution, let's see an example.Input['cat', 'dog', 'fired', 'god', 'pat', 'tap', 'fried', 'tac']Output[['cat', 'tac'], ['dog', 'god'], ['fried', 'fired'], ['pat', 'tap']]We will breakdown the problem into two pieces. First, we will write a function that checks two strings are anagrams or not. Follow the below steps to write code to check anagrams.Initialize the strings.Sort both the strings.If both sorted strings are ... Read More

Getting Sublist Elements Till n in Python

Hafeezul Kareem
Updated on 06-Jul-2020 09:35:59

261 Views

In this tutorial, we are going to write a program that returns a sublist element till nth sublist in a list. Let's say we have the following list with 5 sublists.[['Python', 'Java'], ['C', 'Pascal'], ['Javascript', 'PHP'], ['C#', 'C++'], ['React', 'Angular']] Now, we have to get the first element from the first three sublists. We can get the elements different approaches. Let's see some of them.LoopsMore generic and first thought of the most of programmers is to use loops. Let's see the code using loops.Example Live Demo# initializing the list and N random_list = [['Python', 'Java'], ['C', 'Pascal'], ['Javascript', 'PHP'], ['C# C++'], ... Read More

Check Congruency of Two Triangles in Python

Hafeezul Kareem
Updated on 06-Jul-2020 09:34:32

332 Views

In this tutorial, we are going to check the congruency of two triangles. We are going to check SSS, SAS, and AAA. The similarity of the triangles is proved based on those criteria.We have to check different conditions based on the theorem. Check them in the code below.Example Live Demodef side_side_side(sides_one, sides_two):    # sorting same pace    sides_one.sort()    sides_two.sort()    # checking the conditions    if sides_one[0] / sides_two[0] == sides_one[1] / sides_two[1] \       and sides_one[1] / sides_two[1] == sides_one[2] / sides_two[2] \       and sides_one[2] / sides_two[2] == sides_one[0] / sides_two[0]:     ... Read More

Find Longest Common Directory Path in Python

Hafeezul Kareem
Updated on 06-Jul-2020 09:28:32

477 Views

In this tutorial, we are going to write a program that finds the longest common path from the given list of paths. Let's see an example to understand the problem statement more clearly.Inputpaths = ['home/tutorialspoint/python', 'home/tutorialspoint/c', 'home/tutorialspoint/javascript', 'home/tutorialspoint/react', 'home/tutorialspoint/django']/home/tutorialspoint/We can solve the problem using os module very easily. Let's see the steps to solve theImport the os module.Initialize the list of paths to find the longest common path.Find the common prefix of all paths using os.path.commonprefix(paths) and store it in variable.And extract the directory from the common prefix using os.path.dirname(common_prefix).Example Live Demo# importing the os module import os # initializing the ... Read More

RAM Addressing of 8051 Microprocessor

Arnab Chakraborty
Updated on 06-Jul-2020 09:27:15

2K+ Views

In this section we will see how external RAM memories can be addressed by the Intel 8051 microcontroller. There are different methods for addressing the RAMs. Now at first we will discuss about some different types of RAM memories in short.The RAM (Random Access Memory) is volatile memory. So when the power is cutting off to the RAM chip, it losses the data. RAMs are also known as RAWM (Read and Write Memory). There are basically three kinds of RAMs. These are SRAM (Static RAM), NV-RAM (Non-Volatile RAM) and DRAM (Dynamic RAM).Static RAMThe storage cell in Static RAM are made ... Read More

Advertisements