项目作者: ByeonghoonJeon

项目描述 :
Code for a blind auction.
高级语言: Python
项目地址: git://github.com/ByeonghoonJeon/Blind-Auction-Code.git
创建时间: 2021-04-21T20:07:51Z
项目社区:https://github.com/ByeonghoonJeon/Blind-Auction-Code

开源协议:MIT License

下载


Code for blind auction.
From every input line, it checks correctness of input type to prevent from errors.

3 steps to use

  1. Register your name.
  2. Register your bid.
  3. If there is other participants, type Y. To finish, type N.

As like real auction, if the biding price is duplicated, the first person becomes the winner.

How it works?

This program requires real name. Thus only alphabet is available for the user input.
However, our real name includes period and blank as well in many cases. For this reason, “.” and “ “ is temporarily removed to check the validity of input.

Also user’s number input is checked with isdigit(). Thus user can not input any twisted answer but program’s intended input which is number.

If name and biding price is collected, these information is piled to the dictionary. To avoid same name confusion, if a name is already in the dictionary, The program requires another name.

Consquently, this program filters the maximum value in the dictionary.