Coder Social home page Coder Social logo

multi-val-dict's Introduction

multi-val-dict

A multi-value dictionary

This is a command line program written in Python. It stores a multi-value dictionary in memory. All keys and members are strings. It can treat inputs "in quotes" as one string.

Commands

It supports the following commands:

  • KEYS, MEMBERS, ADD, REMOVE, REMOVEALL, CLEAR, KEYEXISTS, MEMBEREXISTS, ALLMEMBERS, and ITEMS

In addition, I have added support for:

  • HELP -- Lists all supported commands
  • QUIT -- Exits the program and prints out the final results of the dictionary

Further information can be found in the Documentation folder.

Running

The commands in this section are intended for a Linux-based system. I use the Linux subsystem for Windows.

Make sure your version of Python is updated to Python 3.10. You may run into interpretation errors if you attempt to run the program with an earlier version.

To begin, clone a copy of this repo to your machine:

git clone https://github.com/sdvgallardo/multi-val-dict.git

Move to the folder you just cloned:

cd multi-val-dict

Then, execute the program by running it with Python 3:

python3 mvd.py

Then enter your desired commands, adding members to the multi-value dictionary and manipulating it as desired.

When finished, enter QUIT at the prompt, your final dictionary will be provided and the program will cease operation. Any members entered in the dictionary will be lost.

Testing

A file of tests has been included.

To run tests, make sure Pytest has been installed:

pip3 install pytest

Then execute the tests by running them with Pytest:

pytest tests.py

There are 11 tests written with a total of 25 assertions, testing various pieces of the multi-value dictionary program.

multi-val-dict's People

Contributors

sdvgallardo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.