figure - most internet locations provide only an ipv address type socket getservbyport( and press enter you see the output shown in figure - the socket getservbyport(method provides the means to determine how particular port is used port is always dedicated to smtp support on any server sowhen you access : you're asking for the smtp server on localhost in shorta port provides specific kind of access in many situations figure - standardized ports provide specific services on every server close the python shell some people assume that the port information is always provided howeverthis isn' always the case python will provide default port when you don' supply onebut relying on the default port is bad idea because you can' be certain which service will be accessed in additionsome systems use nonstandard port assignments as security feature always get into the habit of using the port number and ensuring that you have the right one for the task at hand