print('Loading...')
import socket
import sys
sock = socket.socket()
print('Enter server IP')
ip = input()
print('Enter server port')
port = input()
port = int(port)
sock.connect((ip, port))
print('Connected!')
while True:
print('Enter a message')
message = input()
sock.send(message) # Ошибка возникает на этой строке, а скриншот ниже
print('Waiting answer...')
answer = sock.recv(1024)
if answer == exit:
sys.exit()
else:
print(answer)