The Host to Network Layer in TCP/IP Model

Arushi
Updated on 17-Jun-2020 12:37:53

6K+ Views

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

Set Key Content with Bootstrap 4 Card

Amit Diwan
Updated on 17-Jun-2020 12:36:31

139 Views

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      

Use Multiple For and While Loops Together in Python

Ankith Reddy
Updated on 17-Jun-2020 12:36:21

372 Views

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.

Generate a Sorted List in Python

Lakshmi Srinivas
Updated on 17-Jun-2020 12:35:01

424 Views

The sort method on lists in python uses the given class's gt and lt operators to compare. Most built in classes already has these operators implemented so it automatically gives you sorted list. You can use it as follows:words = ["Hello", "World", "Foo", "Bar", "Nope"] numbers = [100, 12, 52, 354, 25] words.sort() numbers.sort() print(words) print(numbers)This will give the output:['Bar', 'Foo', 'Hello', 'Nope', 'World'] [12, 25, 52, 100, 354]If you don't want the input list to be sorted in place, you can use the sorted function to do so. For example, words = ["Hello", "World", "Foo", "Bar", "Nope"] sorted_words ... Read More

Bootstrap 4 Button btn-outline-info Class

David Meador
Updated on 17-Jun-2020 12:34:43

198 Views

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

Explain Python For Loop to List Comprehension

Ramu Prasad
Updated on 17-Jun-2020 12:32:24

193 Views

List comprehensions offer a concise way to create lists based on existing lists. When using list comprehensions, lists can be built by leveraging any iterable, including strings and tuples. list comprehensions consist of an iterable containing an expression followed by a for the clause. This can be followed by additional for or if clauses.Let’s look at an example that creates a list based on a string:hello_letters = [letter for letter in 'hello'] print(hello_letters)This will give the output:['h', 'e', 'l', 'l', 'o']string hello is iterable and the letter is assigned a new value every time this loop iterates. This list comprehension ... Read More

The Internet Layer in the TCP/IP Model

Vikyath Ram
Updated on 17-Jun-2020 12:30:56

11K+ Views

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

Use Single Statement Suite with Loops in Python

karthikeya Boyini
Updated on 17-Jun-2020 12:29:42

402 Views

Similar to the if statement syntax, if your while clause consists only of a single statement, it may be placed on the same line as the while header. Here are the syntax and example of a one-line for loop:for i in range(5): print(i)This will give the output:0 1 2 3 4

Change Python For Loop Range Higher Limit at Runtime

Samual Sam
Updated on 17-Jun-2020 12:27:13

428 Views

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

Protocol and Protocol Hierarchies

Jai Janardhan
Updated on 17-Jun-2020 12:27:11

9K+ Views

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

Advertisements