I want to generate all possible words from a text file but my code is not correct.
My existing code:
file = open('../data.txt')
for line in file.readlines():
line = line.strip()
for line1 in file.readlines():
line1 = line1.strip()
print ("{} {}".format(line, line1))
data.txt #-- my data file in text format
hero
muffin
ego
abundant
reply
forward
furnish
Needed Output: #-- generated result
hero muffin
hero ego
hero abundant
hero reply
hero forward
hero furnish
muffin hero
muffin ego
muffin abundant
muffin reply
muffin forward
muffine furnish
ego hero
ego muffin
so on...