Git Product home page Git Product logo

python_basic-2020-7-23-17-10-25-187's Introduction

商店里进行购物结算时会使用收银机(POS)系统,这台收银机会在结算时根据客户的购物车(Cart)中的商品(Item)进行结算和打印收据(Receipt)。

输入(样例):

[

'ITEM000001',

'ITEM000001',

'ITEM000001',

'ITEM000001',

'ITEM000001',

'ITEM000003-2',

'ITEM000005',

'ITEM000005',

'ITEM000005'

]

其中对'ITEM000003-2'来说,"-"之前的是标准的条形码,"-"之后的是数量,数量会有为小数的可能性。 当我们购买需要称量的物品的时候,会由称量的机器生成此类标签(Tag),收银机负责识别生成收据。

使用python函数式的方式完成下列需求:

  1. 对输入的列表进行合并汇总,对于样例输入输出如下:
ITEM000001 5
ITEM000003 2
ITEM000005 3
  1. 在需求1的基础上,写一个方法filterNumber(num)对数量进行过滤,过滤出大于num的商品及其数量,如:filterNumber(3, iter) => ITEM000001 5

python_basic-2020-7-23-17-10-25-187's People

Contributors

linwenjun avatar

Watchers

James Cloos avatar  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.