Calculating the area of a triangle is a formula that you can easily implement in python. If you have the base and height of the triangle, you can use the following code to get the area of the triangle,def get_area(base, height): return 0.5 * base * height print(get_area(10, 15))This will give the output:75If you have the sides of the triangle, you can use herons formula to get the area. For example,def get_area(a, b, c): s = (a+b+c)/2 return (s*(s-a)*(s-b)*(s-c)) ** 0.5 print(get_area(10, 15, 10))This will give the output:49.607837082461074
To align a flex item in the center with Bootstrap 4, use the .align-self-center class.The following is my div for flex −Now add flex items and here I have applied the align-self-center class on the 3rd flex item − A-one B-one C-one D-one You can try to run the following code to implement the align-self-center class in Bootstrap −ExampleLive Demo Bootstrap Example Align Specific Flex Item in the center A-one B-one C-one D-one
The host-to-network layer is the lowest layer of the TCP/IP model and is concerned with the physical transmission of data. It is also called a network interface layer or link layer. It can be considered as the combination of physical layer and data link layer of the OSI model.The functions of this layer are −It defines how bits are to be encoded into optical or electrical pulses.It accepts IP packets from the network layer and encapsulates them into frames. It synchronizes the transmission of the frames as well as the bits making up the frames, between the sender and the ... Read More
Add key stuff to a Bootstrap card, using the bg-primary class with the card class.Use the bg-primary class in the card class − Eisner Award I have used the text-white class above, to set the text to be white.Let us see a example how to include key stuff in a Bootstrap 4 card −ExampleLive Demo Bootstrap Example Awards The Pulitzer Prize Eisner Award Hugo & Nebula Awards
You can create nested loops in python fairly easily. You can even nest a for loop inside a while loop or the other way around. For example,for i in range(5): j = i while j != 0: print(j, end=', ') j -= 1 print("")This will give the output1, 2, 1, 3, 2, 1, 4, 3, 2, 1,You can take this nesting to as many levels as you like.
To set an outline on a button that indicates information, you need to use the btn-outline-info class in Bootstrap.Include the button element and set the btn-outline-info class − More Info You can try to run the following code to implement the btn-outline-info class −ExampleLive Demo Bootstrap Example Event The following are the details: Event Timings 1PM TO 4PM Venue: 21 KH, HG Lane, Alabama For more information about the event: More Info
The Internet layer is responsible for logical transmission of data packets over the internet. It can be compared to the network layer of the OSI model.The main functions of the internet layer are −It transmits data packets to the link layer.It routes each of the data packets independently from the source to the destination, using the optimal route.It reassembles the out-of-order packets when they reach the destination.It handles the error in transmission of data packets and fragmentation of data packets.The protocols used in this layer are −Internet Protocol, IP − It is a connectionless and unreliable protocol that provides a ... Read More
No, You can't modify a range once it is created. Instead what you can do is use a while loop instead. For example, if you have some code like:for i in range(lower_limit, higher_limit, step_size):# some code if i == 10: higher_limit = higher_limit + 5You can change it to:i = lower_limit while i < higher_limit: # some code if i == 10: higher_limit = higher_limit + 5 i += step_size
A protocol is a set of rules and conventions agreed upon and followed by the communicating entities for data communication. A protocol outlines the what, how and when of a communication.The three aspects of a protocol are −Syntax − It defines the format of data that is to be sent or received.Semantics − It defines the meaning of each section of bits that are transferred.Timings − It defines the time at which data is transferred as well as the speed at which it is transferred.Protocol HierarchiesMost networks are organized as a stack of layers, one on the top of another. ... Read More
A connection-oriented service is one that establishes a dedicated connection between the communicating entities before data communication commences. It is modeled after the telephone system. To use a connection-oriented service, the user first establishes a connection, uses it and then releases it. In connection-oriented services, the data streams/packets are delivered to the receiver in the same order in which they have been sent by the sender.Connection-oriented services may be done in either of the following ways −Circuit-switched connection: In circuit switching, a dedicated physical path or a circuit is established between the communicating nodes and then data stream is transferred.Virtual circuit-switched ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP