Code Monkey home page Code Monkey logo

w08_d01_warmup's Introduction

Pizzeria

In an attempt to boost sales, the manager of the pizzeria you work at has devised a pizza rewards system: if you already made at least 5 orders of at least 20 dollars => you get a free 12 inch pizza with 3 toppings of your choice! However, the rewards system may change in the future. Your manager wants you to implement a function that, given :

  1. a dictionary of customers,
  2. a minimum number of orders
  3. a minimum order price,
  4. returns a set of the customers who are eligible for a reward.

Try and use the .Filter method!

Tests:

//Make at least 3 orders of at least 15$ each and get a free pizza!
min_orders = 3
min_price = 15
customers = {
'Ahmad' : [15, 15, 14], # Only has two orders of 15$ or more, so no pizza
'Yasser' : [15, 15, 15], # Has three orders of 15$ or more, which means FREE PIZZA!
'Ebere' : [120, 240], # Only has two orders of 15$ or more, so no pizza
}
min_orders = 2
min_price = 50
customers = {
'Amal ' : [22, 67, 53, 29],
'Fahad' : [51, 19]
}
min_orders = 5
min_price = 20
customers = {
'Sarah' : [22, 30, 11, 17, 15, 52, 27, 12], 
'Anas' : [5, 17, 30, 33, 40, 22, 26, 10, 11, 45]
}

w08_d01_warmup's People

Contributors

atheer10 avatar

Watchers

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