Skip to content

Instantly share code, notes, and snippets.

@gokaybiz
Created November 22, 2020 20:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gokaybiz/b4c54d666ada72f8492a9532dea056c2 to your computer and use it in GitHub Desktop.
Save gokaybiz/b4c54d666ada72f8492a9532dea056c2 to your computer and use it in GitHub Desktop.
Simple dictionary script for unskilled someone's homework.
#! /bin/python
word_list_tr = {
"armut": "pear",
"mühendis": "engineer",
"aday": "candidate",
"niteliksiz": "unskilled",
"öğrenci": "schoolgirl",
"iş": "business",
"beceriksiz": "ineffectual"
}
word_list_en = {word: kelime for kelime, word in word_list_tr.items()}
try:
while(True):
read_input = input('Bir kelime giriniz (Enter a word): ')
read_input = read_input.strip().lower()
if (len(read_input) < 1):
continue
meaning = None
if read_input in word_list_tr:
meaning = word_list_tr[read_input]
if read_input in word_list_en:
meaning = word_list_en[read_input]
if meaning is not None:
print('{}: {}'.format(read_input, meaning))
else:
print('Kelime bulunamadi! (Word couldn\'t found!)')
except KeyboardInterrupt:
print('\n\nProgram sonlandirildi!')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment