Question

Identify 5 things that establish a lookup relationship and define them as dictionaries.As an example consider...

Identify 5 things that establish a lookup relationship and define them as dictionaries.As an example consider the mapping of State names to their abreviations(e.g. "Maryland" to "MD").You must find a diversity of things and they must have at least 6 keys each. (python 3)

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Dictionaries in Python:

Dictionary is a collection of referable entry or a key-value pair in which every key has a value associated with it. The keys in a dictionary must be unique in order for the search to return a unique value as a result of a search query.

We can in general also call the dictionary as a Lookup Table as using the key we look up the value it correspond to in the table defined. The Lookup table or dictionary can be of any thing example being : Abbreviation of a city name and it's Letter code etc.

Things that can form a look up relation :

1. Lookup table of serial number and student .A class of 60 students who get Serial Number for teacher's ease e.g 1-Arjun, 2-Daniel, 3-Brad, 4-Sasy, 5- Anil, 6- Peter

2. Lookup table of whether an eatable item is fruit, snack, main-course, Desserts etc. example "Apple" : "Fruit", "Chowmein" : "Snack", "BeetRoot" : "Vegetable", "Patato": "Vegetable", "Cake": "Deserts", "Wine" : "beverages".

3. Subject code and the subject names usually used in schools/ Colleges e.g ETME : Engneering Mechanics, ETMA : Engneering Mathematics, ETPH : Engneering Physics, ETEC : Engneering Chemistry, ETDS : Engneering Data Structues, ETOS : Engneering OS

4. International Airports Code example Aarhus - AAR, Aberdeen- ABZ, Abilene- ABL, Abu Rudeis- AUE, Agadir-ADA, Aguadilla- BQN

5. Number in representational and numerical form e.g "one" - 1, "Two"- 2, "Three" - 3, "Four" -4, "Five"-5, "six"-6

Python Syntax:

dict1 = {'1':'Arjun', '2':'Daniel', '3':'Brad', '4':'Sasy', '5':'Anil', '6':'Peter'}

dict2 = {'Apple':'Fruit', 'Chowmein':'Snack', 'Beetroot':'Vegetable', 'Patato':'Vegetable', 'Cake':'Desert', 'Wine':'Beverage'}

dict3 = {'ETME':'Engneering Mechanics', 'ETMA':'Engneering Mathematics', 'ETPH':'Engneering Physics', 'ETEC':'Engneering Chemistry', 'ETDS':'Engneering and Data Structure', 'ETOS':'Engneering and OS'}

dict4 = {'AAR':'Arahus', 'ABZ':'Aberdeen', 'ABL':'', 'AUE':'Abu Rudeis', 'ADA':'Agadir', 'BNQ':'Aguadilia'}

dict5 = {'1':'One', '2':'Two', '3':'Three', '4':'Four', '5':'Five', '6':'Six'}

Hope my effort helps your cause.

Thanks and Regards!!!!!!!!!!!!!!!!

Add a comment
Know the answer?
Add Answer to:
Identify 5 things that establish a lookup relationship and define them as dictionaries.As an example consider...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Define the functions in Python 3.8 1. Write a function most frequent n that takes a...

    Define the functions in Python 3.8 1. Write a function most frequent n that takes a list of strings and an integer n, and that returns a dictionary where the keys are the top n most frequent unique words in the list, and the values are the frequency of each word: For example, most frequent n(text, 3) should return the dictionary {'is': 2, "the’: 3, 'of': 2}, and most frequent n(text, 2) could return either {'is': 2, 'the’: 3} or...

  • Java 1 Some help Please...... 1. Before You Begin Anticipate where things can go wrong Consider...

    Java 1 Some help Please...... 1. Before You Begin Anticipate where things can go wrong Consider how to gracefully shut down the program and save the users data and close files properly. Typically there are two scenarios to make a distinction between: The first is one that which you have absolutely no control over; such as if all the files are where they should be, and that the user has not deleted one or accidentally moved it rather than copied...

  • 0. Introduction. This involves designing a perfect hash function for a small set of strings. It...

    0. Introduction. This involves designing a perfect hash function for a small set of strings. It demonstrates that if the set of possible keys is small, then a perfect hash function need not be hard to design, or hard to understand. 1. Theory. A hash table is an array that associates keys with values. A hash function takes a key as its argument, and returns an index in the array. The object that appears at the index is the key’s...

  • (MMU) has decided to consolidate the functionality of three small overlapping database systems, which support applications...

    (MMU) has decided to consolidate the functionality of three small overlapping database systems, which support applications for 1) teaching (e.g. instructor assignment and evaluation), for 2) registration (e.g. online course status, waiting lists), and for 3) student records (e.g. transcript generation) The resulting new system will support the following enterprise description: Professors and GTAs are assigned to teach the sections of each class being offered in a semester. At the end of the semester, they get a "team rating" (professors...

  • Consider the following problem based on the transformation of a sequence (or collection) of coloured disks Assume that...

    Consider the following problem based on the transformation of a sequence (or collection) of coloured disks Assume that you have a very large collection of disks, each with an integer value representing the disk colour from the range [0, c. For example, the colour mapping might be: O-red, 1-yellow, 2-blue, 3-pink. ..., c-black For a given sequence of coloured disks e.g., ( 0,1,2,3,4 ), at each time step (or iteration) you are only allowed to perform one of three basic...

  • Need help with a few programming exercises. The language being used for all of them is...

    Need help with a few programming exercises. The language being used for all of them is JAVA. 1) exercises - branching (language is JAVA) • Write a method whatToWear(int temp) that takes a temperature and then outputs a string for what to wear in different weather conditions. There must be at least 3 categories. For example, whatToWear(90) might return “shorts” and whatToWear(30) might return “down coat” 2) Enum exercise • Define an enum Seasons, and rewrite the whatToWear method to...

  • Consider the following problem based on the transformation of a sequence (or collection) of coloured disks...

    Consider the following problem based on the transformation of a sequence (or collection) of coloured disks Assume that you have a very large collection of disks, each with an integer value representing the disk colour from the range [0, c. For example, the colour mapping might be: O-red, 1-yellow, 2-blue, 3-pink. ..., c-black For a given sequence of coloured disks e.g., ( 0,1,2,3,4 ), at each time step (or iteration) you are only allowed to perform one of three basic...

  • Hey guys I need help with this assignment. However it contains 7 sub-problems to solve but I figured only 4 of them can...

    Hey guys I need help with this assignment. However it contains 7 sub-problems to solve but I figured only 4 of them can be solved in one post so I posted the other on another question so please check them out as well :) Here is the questions in this assignment: Note: Two helper functions Some of the testing codes for the functions in this assignment makes use of the print_dict in_key_order (a dict) function which prints dictionary keyvalue pairs...

  • please do a and b Lab Exercise 9 Assignment Overview This lab exercise provides practice with...

    please do a and b Lab Exercise 9 Assignment Overview This lab exercise provides practice with dictionaries of lists and sets in Python. A. Write a program using Dictionaries of lists Consider the file named "lab9a.ру" Given two files named exactly continents. txt and cities.txt (no error checking of the file name is needed) of continents, countries and cities. Write a program to read continents, countries and their cities, put them in a nested dictionary and print them (no duplicates...

  • Your project will require you to develop a database design to solve a real-life data management...

    Your project will require you to develop a database design to solve a real-life data management problem. It can be any problem in your work environment or for another organization, for example, a bookstore (think of how Amazon uses databases), a course management system (think of how a university manages courses), a bank (think of how your bank works), and an online auction site (think of how Ebay works). You will develop a database to solve this problem You will...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT