1- Make sure you check the inputs and validate them. We check your code with different inputs. In other words, we try to break your code. Your code must be resistance to different kinds of user...

python question


1- Make sure you check the inputs and validate them. We check your code with different inputs. In other words, we try to break your code. Your code must be resistance to different kinds of user inputs. Unless I have mentioned something is out of scope, you assume all the possible inputs. Question 4) I have shown you how to make a dictionary suggestion in the Day 07 notes. Now I want you to use that knowledge in answering the following question: We want to implement an autocomplete feature that provides suggestions as a user types a phrase in the search field. The autocomplete is like the Google search suggests a feature. When you start searching for a keyword in the Google search, it suggests a few items to you to make life easier for you. The list we have in mind currently has a product catalog of around 3 million objects and only want to autocomplete the product name. Use the products.json in the following link: https://github.com/ BestBuyAPIs/open-data-set That is the BestBuy product names. If you save the products.json on the local desktop and open that by MS Excel, you get some idea about its format. This is what it looks like: https://github.com/BestBuyAPIs/open-data-set https://github.com/BestBuyAPIs/open-data-set It has a list (i.e. the entire product is in []) that each of its elements is a python dictionary with keys and values. You have seen a similar data model when we tried to model the Spotify website in the class. You are just interested to pick the key =name. Column C and D sound good candidate to build the dictioney structure. You do not care about the rest. To simplify the solution you can limit the search suggestions to 5 suggestions to users. I have written a code for you to not to worry about loading the keys and values. Run this code in the same folder that your JSON file is located: If you run this code you get this result: As you see in the above screenshot you have repeated names like Corliving. Please merge them into one dictionary record. For example, one key Corliving with more than one value. So you will have a dictionary with a key that may have many values and each value is an item in a list. You know how to search and suggest a Python dictionary data structure when you worked on the Notes on Day_07 Dictionary practice 1. Use the same technique to answer this question.
Feb 27, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here