Can someone explain why else is getting IndentationError: unexpected unindent while i try to work further on my if else loop.
Basicly am working on a port scanner project where i need to get some user input where out of this user input, i will specify how many ports there is needed to scan. My plan was to work further on the if command, so if i do not get the response of 1 the meaning was to next. But it do not seem like to work
Whats wrong?
input = input("1 or 2")
if input == '1':
        try:
                for port in range(1,65535):
                        s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
                        socket.setdefaulttimeout(1)
                        result = s.connect_ex((target,port))
                        if result ==0:
                                print("Port {} is open".format(port))
                        s.close()
else:
        print("do not work")
        except KeyboardInterrupt:
                print("\n ")
                sys.exit()
        except socket.gaierror:
                print("\n ")
                sys.exit()
        except socket.error:
                print("\")
                sys.exit()
 
     
    