CopyPastor

Detecting plagiarism made easy.

Score: 1.8262958526611328; Reported for: String similarity, Exact paragraph match Open both answers

Possible Plagiarism

Plagiarized on 2019-01-15
by Sagar P. Ghagare

Original Post

Original - Posted on 2010-05-14
by Albert



            
Present in both answers; Present only in the new answer; Present only in the old answer;

Alternatively you can use my solution:
def get_open_port(): import socket s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.bind(("",0)) s.listen(1) port = s.getsockname()[1] s.close() return port
Not very nice and also not 100% correct but it works for now.
My current solution:
def get_open_port(): import socket s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.bind(("",0)) s.listen(1) port = s.getsockname()[1] s.close() return port
Not very nice and also not 100% correct but it works for now.

        
Present in both answers; Present only in the new answer; Present only in the old answer;