CSCI161 Assignment 6 Solved

25.00 $

Category: Tags: , ,
Click Category Button to View Your Next Assignment | Homework

You'll get a download link with a: zip solution files instantly, after Payment

Securely Powered by: Secure Checkout

Description

Rate this product

Objective:
To work with dictionaries in python. Assignment:

Create a function menu(),for displaying the following options.

Option 1: Create and display the dictionary.
Option 2: Search a value in the dictionary.
Option 3: Sort the dictionary based on keys.
Option 4: Display the keys and values of the dictionary as two separate lists. Option 5: Exit

Points 10

If the user input for the option is 1, then call display(), which will create a dictionary by taking the user input items for (key, value) for the dictionary and display it. The keys of the dictionary are integer type and the values of the dictionary are strings.

If the user input for the option is 2, then call search(), which will accept a user input value as string and check whether the entered value exists in the dictionary or not.

If the user input for the option is 3, then call sort(), which sort the dictionary based on the keys in the dictionary.

If the user input for the option is 4, then call lists(), which will get the keys and values from the dictionary and display them as two separate lists, where the two lists are sorted.

If the user input for the option is 5, then exit from the program. Only option to exit from the menu is option 5.

Sample Output:

Instructions:

• Preferred programming environment:

o OS
o Interpreter o Editor

: Linux (Mint)
: Python 3 (not Python 2)
: gedit or editor of your choice

  • The program is saved as a file with .py extension.
  • The program should include a comment block at the top with your name, course number and course section, assignment number
  • assignment6-30f5bk.zip