1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
otez555 [7]
3 years ago
13

Write an If/else statement to check whether host is online. If it is online, then print system is online otherwise print system

is unreachable.
Computers and Technology
1 answer:
Reika [66]3 years ago
4 0

Answer:

from socket import *

hostname = input('Enter the host to be scanned: ')

ip_add = gethostbyname(hostname)

connections = [ ]    

for i in range(133, 136):

   s = socket(AF_INET, SOCK_STREAM)

     

   conn = s.connect_ex((ip_add, i))

   print(conn)

   connections.append(conn)

if 0 in connections:

   print ('Host is online')

   s.close()

else:

   print ('system is unreachable')

Explanation:

The python source code above scans for all the available range of ports in the provided hostname, if any port is available, the host is online else the program print the error message "system is unreachable.

You might be interested in
100 POINTS!!!!!!!!
raketka [301]

Answer:

Option B

Securing Unattended Equipments

3 0
3 years ago
Read 2 more answers
From the Table Style Options area of the Design tab, you select Banded Columns. What will happen to your table?
sukhopar [10]
When you are using excel and you input banded column command, your table will automatically receive alternate shading. That is, background color will be applied to every other row in your work sheet. This design will allow the users of the worksheet to easily spot relevant information.
8 0
3 years ago
When you use the keyboard to scroll to a different position in the document, the ____ automatically moves when you press the des
FrozenT [24]

Answer:

Option C i.e., insertion point is the correct option.

Explanation:

if any user or person scrolls the following contents by using the keyboard from one position to another position in the document of the user then, the insertion point moves automatically without any implementation when the user presses any key they want. If the user clicks on the arrow keys then, it also works like that. So, that's why the following option is correct.

8 0
3 years ago
Identifying the problem is crucial when trying to solve a problem. There are several techniques that you can use to aide you in
erica [24]
Consensus Building is NOT a technique that you can use to help you in identifying a problem.
8 0
3 years ago
What is the number base of the binary number system?
Margarita [4]

Answer:

2

Explanation:

The system only uses 2 numbers which are 0 and 1 instead of the usual 10 numbers; 0, 1, 2, 3, 4, 5, 6, 7, 8 & 9.

4 0
1 year ago
Other questions:
  • Advantages of a personal area network
    5·1 answer
  • Suppose that TCP's current estimated values for the round trip time (estimatedRTT) and deviation in the RTT (DevRTT) are 400 mse
    9·1 answer
  • "The study of how changes in the input parameters of a linear programming problem affect the optimal solution is known as
    8·1 answer
  • Clunker Motors Inc. is recalling all vehicles from model years 2001-2006. Given a variable modelYear write a statement that prin
    8·1 answer
  • What does psychologist Edward Spector mean when he says “ We have an entire generation of guinea pigs in an experiment”?
    14·1 answer
  • Question 7 of 10
    13·1 answer
  • Someone places a chocolate bar near a working radar set that is used to locate ships and airplanes. Which best describes what is
    15·2 answers
  • To obtain the desired speedup, make sure your new function recursively calls itself no more than once in the body of the method.
    8·1 answer
  • Which of the following is an object such as a field which can be inserted into a document
    7·1 answer
  • State the name of each of the storage devices described below.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!