words = ["python","java","php","javascript"]
with_letter = {}
for word in words:
letter = word[0]
if letter not in with_letter:
with_letter[letter] = [word]
else:
with_letter[letter].append(word)
print(with_letter)
Posted inPython