Created
November 22, 2020 20:40
-
-
Save gokaybiz/b4c54d666ada72f8492a9532dea056c2 to your computer and use it in GitHub Desktop.
Simple dictionary script for unskilled someone's homework.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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