You're running an online business and a big part of your day is fulfilling orders. As your volume picks up that's been taking more of your time, and unfortunately lately you've been running into situations where you take an order but can't fulfill it.
You've decided to write a function fillable() that takes three arguments: a dictionary stock representing all the merchandise you have in stock, a string merch representing the thing your customer wants to buy, and an integer n representing the number of units of merch they would like to buy. Your function should return True if you have the merchandise in stock to complete the sale, otherwise it should return False.
Valid data will always be passed in and n will always be >= 1.
وده الكود بتاعي
def fillable(stcok , merch , n):if stcok isnotNoneand n >=1:returnTrueelse:returnFalseprint(fillable("iphone","mac",2))
انا عاوز اعارف فين المشكله
بس من غير كنابه الكود لو سمحتو
تم التعديل في بواسطة Mustafa Suleiman تعديل عنوان السؤال
السؤال
Ail Ahmed
السلام عليكم
المشكله ده
You're running an online business and a big part of your day is fulfilling orders. As your volume picks up that's been taking more of your time, and unfortunately lately you've been running into situations where you take an order but can't fulfill it.
You've decided to write a function fillable() that takes three arguments: a dictionary stock representing all the merchandise you have in stock, a string merch representing the thing your customer wants to buy, and an integer n representing the number of units of merch they would like to buy. Your function should return True if you have the merchandise in stock to complete the sale, otherwise it should return False.
Valid data will always be passed in and n will always be >= 1.
وده الكود بتاعي
انا عاوز اعارف فين المشكله
بس من غير كنابه الكود لو سمحتو
تم التعديل في بواسطة Mustafa Suleimanتعديل عنوان السؤال
13 أجوبة على هذا السؤال
Recommended Posts
انضم إلى النقاش
يمكنك أن تنشر الآن وتسجل لاحقًا. إذا كان لديك حساب، فسجل الدخول الآن لتنشر باسم حسابك.