Skip to main content

A Python package to which allocate parking slot for Car.

Project description

This repository gives an overview of how we can design a basic parking lot in Python. It creates parking lot with given number of slots. The cars follow Greedy approach while being parked in the slots.

index.py = Main File(The file which you have to Run) classes.py = The file where I declare and define my class and it's member function. Function.py = The file where I declare and define non member function. input.txt = The file which contains input.You can change according to your requirment.

index.py script defines the following functions -

create_parking_lot n - Given n number of slots, create a parking lot

park car_regno car_color - Parks a vehicle with given registration number and color in the nearest empty slot possible. If there are no more empty slots available, it shows a message "Sorry, parking lot is full".

status - Prints the slot number, registration number and color of the parked vehicles.

leave x - Removes vehicle from slot number x

There are few query functions to retrieve slot number from registration number of car, get registration numbers of cars with particular color etc.

index.py can be run through shell or through file containing test cases. I did with file handling, In file input.txt all the test cases are there.You just need to run index.py,the desired output will be display in your screen.

Additional Functionality :

I have added a feature by which you can extend the number of parking slot if you required at any instance of program.To perform this you will have to add a command in input file.(modify 10).This will add 10 more new slot.

I have added a feature by which You can check the available slot.To perform this you will have to add a command in input file.(display_avaiable_slot).This will show all free slot.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

parking-lot-1.0.3.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

parking_lot-1.0.3-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file parking-lot-1.0.3.tar.gz.

File metadata

  • Download URL: parking-lot-1.0.3.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.8.5

File hashes

Hashes for parking-lot-1.0.3.tar.gz
Algorithm Hash digest
SHA256 c077db91b9c5db068a07a0d1000c76dede40b3df628ddc73c095e6c8a4b6906c
MD5 c9dbbbd12fa3e66f7e776f21b4ca6b2d
BLAKE2b-256 371e5e715575cbbf71250b7ee0783794ddf863c5ff4277fc58ce29e362752c73

See more details on using hashes here.

File details

Details for the file parking_lot-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: parking_lot-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.8.5

File hashes

Hashes for parking_lot-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6ddec4475461529d17eff684309421b8808e9a899079da0bf99ad83ceaca9603
MD5 ec86bda166db0fcafa9ca26bf6221444
BLAKE2b-256 3b2995d9705ee694836dd2ecf2a3dc279f7ce2b60d0580ef671d9fc7049a3e6e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page