Need help with your Discussion

Get a timely done, PLAGIARISM-FREE paper
from our highly-qualified writers!

glass
pen
clip
papers
heaphones

Hood College Python Worksheet

Hood College Python Worksheet

Hood College Python Worksheet

Description

Unformatted Attachment Preview

CSIT 512 Elements of Computer Programming
Module 9 Graded Program
Focus on dictionary methods, use of functions, and good programming style
For this assignment, you will create a glossary (dictionary) of technical terms and definitions. It will be
set up as a Python dictionary structure. The file glossary_starter.py is a complete starter framework for
the assignment. It includes some initial values for the dictionary. It is long because most of the code
has already been written for you.
Your task is to complete the five individual functions for adding and deleting terms, looking up terms, listing
them, and printing out both the terms and definitions. These functions are all short, just a couple of lines, and
use basic dictionary methods and techniques.
Here is some sample output.
CSIT 512 Elements of Computer Programming
Module 9 Graded Program
Notice that for 2 and 5, the terms are listed in alphabetical order. Also, lookup and delete should not be case sensitive.
“”” Program framework for module 9 graded program
Creating a dictionary of technical terms and basic definitions
key – the word to define
value – the definition of the word
Note: This isn’t a usable application, as new data added is just temporary.
“””
tech_terms = { “dict”: “stores a key/value pair”,
“list”: “stores a value at each index”,
“map”: “see ‘dict'”,
“set”: “stores unordered unique elements” }
def main():
“”” Keeps presenting the menu to the user till user asks to quit “””
# Present main menu
choice = menu()
# While user hasn’t asked to quit
while choice != “6”:
try:
# Run the code depending on user’s choice
choice = int(choice)
run(choice)
except:
# User didn’t enter a number
print(“Invalid input, please enter a valid number (1-5)”)
# Get next choice from user
choice = menu()
def menu():
“”” Print a simple menu to the user “””
print(“Systems Dictionary”)
print(“1) Add a term”)
print(“2) List terms”)
print(“3) Get a definition”)
print(“4) Delete a term”)
print(“5) Print out dictionary”)
print(“6) Quit”)
return input(“Enter your choice: “)
def run(choice):
“”” Runs one of the actions that the user choose. Valid choices are:
1-5 each of which corresponds to a specific action “””
if choice == 1:
add()
elif choice == 2:
list()
elif choice == 3:
lookup()
elif choice == 4:
delete()
elif choice == 5:
show_it()
else:
print(“Invalid input, please enter a valid number (1-6)”)
def add():
“”” Adds a term to the dictionary “””
# Get a new term and definition from the user
# Add the term/definition from the user to the dictionary
def list():
“”” List all the terms (no definitions) that are in the dictionary.
Once all terms have been listed, this function will also print
the total number of entries in the dictionary “””
# TODO: Add your code here
def lookup():
“”” Lookup a term and print the definition “””
# Get a term to lookup in the dictionary from the user
# Print the definition for the term
# TODO: Add your code here
def delete():
“”” Deletes a term from the dictionary “””
# Get a term to delete from the user
# Delete the term specified by the user from the dictionary
# TODO: Add your code here
def show_it():
“”” Displays the full dictionary “””
# Display the terms and definitions nicely formatted
# TODO: Add your code here
# Run the program
main()

Purchase answer to see full
attachment
Explanation & Answer:

Worksheet

User generated content is uploaded by users for the purposes of learning and should be used following our honor code & terms of service.

Have a similar assignment? "Place an order for your assignment and have exceptional work written by our team of experts, guaranteeing you A results."

Order Solution Now

Our Service Charter


1. Professional & Expert Writers: Eminence Papers only hires the best. Our writers are specially selected and recruited, after which they undergo further training to perfect their skills for specialization purposes. Moreover, our writers are holders of masters and Ph.D. degrees. They have impressive academic records, besides being native English speakers.

2. Top Quality Papers: Our customers are always guaranteed of papers that exceed their expectations. All our writers have +5 years of experience. This implies that all papers are written by individuals who are experts in their fields. In addition, the quality team reviews all the papers before sending them to the customers.

3. Plagiarism-Free Papers: All papers provided by Eminence Papers are written from scratch. Appropriate referencing and citation of key information are followed. Plagiarism checkers are used by the Quality assurance team and our editors just to double-check that there are no instances of plagiarism.

4. Timely Delivery: Time wasted is equivalent to a failed dedication and commitment. Eminence Papers are known for the timely delivery of any pending customer orders. Customers are well informed of the progress of their papers to ensure they keep track of what the writer is providing before the final draft is sent for grading.

5. Affordable Prices: Our prices are fairly structured to fit in all groups. Any customer willing to place their assignments with us can do so at very affordable prices. In addition, our customers enjoy regular discounts and bonuses.

6. 24/7 Customer Support: At Eminence Papers, we have put in place a team of experts who answer all customer inquiries promptly. The best part is the ever-availability of the team. Customers can make inquiries anytime.

We Can Write It for You! Enjoy 20% OFF on This Order. Use Code SAVE20

Stuck with your Assignment?

Enjoy 20% OFF Today
Use code SAVE20