Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
学ぶ Challenge: Boolean Logic | Section
Python Fundamentals for Data Science
セクション 1.  13
single

single

bookChallenge: Boolean Logic

メニューを表示するにはスワイプしてください

This challenge will require you to use the and, or, and not operators as well as boolean comparison operators to manage a complex scenario for a grocery store.

タスク

スワイプしてコーディングを開始

Determine whether a grocery item should be discounted based on its seasonal status, stock level, and sales performance.

  • Define a boolean variable overstock_risk as True if the item is seasonal and its current_stock exceeds the high_stock_threshold.
  • Define another boolean variable discount_eligible as True if the item is not selling_well and is not already on_sale.
  • Create a boolean variable make_discount that is True if either overstock_risk or discount_eligible is True.

Output Requirements

Print whether the item should be discounted: Should the item be discounted? <make_discount>.

解答

Switch to desktop実践的な練習のためにデスクトップに切り替える下記のオプションのいずれかを利用して、現在の場所から続行する
すべて明確でしたか?

どのように改善できますか?

フィードバックありがとうございます!

セクション 1.  13
single

single

AIに質問する

expand

AIに質問する

ChatGPT

何でも質問するか、提案された質問の1つを試してチャットを始めてください

some-alt