Pairpal

Find pairs of words which form palindromes and write to standard output
import sys file = open("words.txt","r") words = file.read data = words.split("\n") for y in data: for x in data: z = "".join([y,x]) w = z[:][::-1] if w == z:            v = "".join([y," ",x]) sys.stdout.write('\n'+v)
 * 1) !/usr/bin/python