human center because we describe stuff by what we see and obserevs
Answer:
- common = []
- num1 = 8
- num2 = 24
- for i in range(1, num1 + 1):
- if(num1 % i == 0 and num2 % i == 0):
- common.append(i)
- print(common)
Explanation:
The solution is written in Python 3.
Firstly create a common list to hold a list of the common factor between 8 and 24 (Line 1).
Create two variables num1, and num2 and set 8 and 24 as their values, respectively (Line 3 - 4).
Create a for loop to traverse through the number from 1 to 8 and use modulus operator to check if num1 and num2 are divisible by current i value. If so the remainder of both num1%i and num2%i will be zero and the if block will run to append the current i value to common list (Line 6-8).
After the loop, print the common list and we shall get [1, 2, 4, 8]
Answer:
Answered below
Explanation:
aFile = open("books.txt", "r")
This code uses the function open() which takes two parameters. The first parameter is the file name while the second parameter is the mode in which you are accessing the file.
The "r" mode opens the file in a reading state. That is, you can only read from the file. This code completes the reading process
aFile.read( )
The "w" mode opens the file so you can write to it and make changes.
The "a" mode opens the file so you can add contents to it.
Answer:
All the ports in a hub are in the same collision domain and a hub sends frames from one host to all other hosts in the network. This makes it prone to collision and poor network throughput. Just like a network switch, it uses the CSMA/CD protocol to detect collision in its network.
A network switch reduces its collision domain to just a port and sends frames from one host to another using its mac table as a route. This makes the network very efficient with high throughput. It also uses the CSMA/CD protocol to detect collision
Explanation:
Switches and hubs are used in networking to connect computer devices in a network. A hub is an obsolete device networking that broadcast a frame to all other ports or host in the network except for the send host port. This increases the rate of collision as all the ports in a hub share the same collision domain. A switch is an efficient frame switching device in a network, which uses its MAC table to decide and find a destination host.
CSMA/CD is a collision detection protocol used in a network to detect and prevent a collision. With this protocol, a host is able to listen, wait, send and resend frames to prevent a collision.