How about RIOT and REVOLT?
Somewhat fitting are:
VIAL and RETORT; though a vial is usually small and glass and one meaning of retort is a large metal container involved in making charcoal.
And in the probably not category:
OTTER and RIVAL which could make sense if two otters were in a contest, perhaps a potential mate.
I have a file 'words' which has 46893 words in it.
I ran the program several times, with w5 and w5, and later with w4 and w6, and so on to make sure the total number of letters was 10
------
def isincluded(s1, s2):
""" bool, True if some all the characters of s1 are in s2 """
hay = s2
for ch in s1:
if ch not in hay:
return [False, hay]
elif ch in hay:
hay = hay.replace(ch,'',1)
# if len(s1) + len(hay) != len(s2):
# print(s1,s2,hay)
return [True, hay]
pool = 'ILTROVATORE'
pool = pool.lower()
w2 = [w for w in words if len(w) == 2 and isincluded(w,pool)[0]]
w3 = [w for w in words if len(w) == 3 and isincluded(w,pool)[0]]
w4 = [w for w in words if len(w) == 4 and isincluded(w,pool)[0]]
w5 = [w for w in words if len(w) == 5 and isincluded(w,pool)[0]]
w6 = [w for w in words if len(w) == 6 and isincluded(w,pool)[0]]
w7 = [w for w in words if len(w) == 7 and isincluded(w,pool)[0]]
w8 = [w for w in words if len(w) == 8 and isincluded(w,pool)[0]]
# from itertools import combinations:
# for comb in combinations
ans = []
for a in w5:
smallpool = isincluded(a, pool)[1]
# print(a,smallpool)
for b in w5:
if isincluded(b,smallpool)[0]:
if [b,a] not in ans:
ans.append([a,b])
print(ans)
|
Posted by Larry
on 2023-04-18 20:01:17 |