naval battle write in python