Skip to main content

Posts

Showing posts from December, 2020

Build an App from the scratch using Python

 Hey Friends!! The code used in the video is given below: CODE: import json from difflib import get_close_matches jsonfile = json.load(open("data1.json")) word = input("enter the word: ") def check(d):      d = d.lower()     if d in jsonfile:         return jsonfile[d]     elif len(get_close_matches(d,jsonfile.keys())) > 0:         choice = input("Did you mean %s , Enter Y for YES, N for NO "  %get_close_matches(d,jsonfile.keys())[0])         if choice == "Y" or "y":             return jsonfile[get_close_matches(d,jsonfile.keys())[0]]         elif choice == "N" or "n":             return "The word doesn't exist, please enter the correct word"         else:             return "you enterd the wrong choice"     else:         return "The word doesn't exist, please enter the correct word" result = (check(word)) if type(result) == list:     for i in result:         print(i) else: