import random
from socket import *

server_address='127.0.0.1'
port = 12000
serverSocket = socket(AF_INET, SOCK_DGRAM)
serverSocket.bind((server_address, port))

print ("starting up on %s port %d" % (server_address, port) )

while True:
	rand = random.randint(0, 10)
	message, address = serverSocket.recvfrom(1024)
	message = message.upper()
	print(message)
	if rand >= 0:
		serverSocket.sendto(message, address) 