Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Challenge | Conditional Statements
Introduction to Python Video Course
course content

Course Content

Introduction to Python Video Course

Introduction to Python Video Course

1. Getting Started
2. Variables and Types
3. Conditional Statements
4. Other Data Types
5. Loops
6. Functions

Challenge

Ready to put everything you've learned into practice? 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.

Let's dive in!

Task

You need to determine if a grocery item should be discounted based on its seasonal status, stock level, and sales performance.

  1. Use the predefined conditions to determine if an item is at risk of being overstocked by checking if it is seasonal and its stock exceeds a specific threshold. If the item is seasonal and the current_stock is greater than the high_stock_threshold, then the boolean variable overstockRisk should become True.
  2. Evaluate if an item is eligible for a discount based on its sales performance and whether it is already on sale. Check if the item is not selling_well and not already on_sale.
  3. Decide if the item should be discounted based on the overstock risk or its discount eligibility results. The makeDiscount boolean variable should become True if either overstockRisk or discountEligible is True.
  4. Print whether the item should be discounted based on the final combined condition - makeDiscount.

Task

You need to determine if a grocery item should be discounted based on its seasonal status, stock level, and sales performance.

  1. Use the predefined conditions to determine if an item is at risk of being overstocked by checking if it is seasonal and its stock exceeds a specific threshold. If the item is seasonal and the current_stock is greater than the high_stock_threshold, then the boolean variable overstockRisk should become True.
  2. Evaluate if an item is eligible for a discount based on its sales performance and whether it is already on sale. Check if the item is not selling_well and not already on_sale.
  3. Decide if the item should be discounted based on the overstock risk or its discount eligibility results. The makeDiscount boolean variable should become True if either overstockRisk or discountEligible is True.
  4. Print whether the item should be discounted based on the final combined condition - makeDiscount.

Switch to desktop for real-world practiceContinue from where you are using one of the options below

Everything was clear?

Section 3. Chapter 3
toggle bottom row

Challenge

Ready to put everything you've learned into practice? 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.

Let's dive in!

Task

You need to determine if a grocery item should be discounted based on its seasonal status, stock level, and sales performance.

  1. Use the predefined conditions to determine if an item is at risk of being overstocked by checking if it is seasonal and its stock exceeds a specific threshold. If the item is seasonal and the current_stock is greater than the high_stock_threshold, then the boolean variable overstockRisk should become True.
  2. Evaluate if an item is eligible for a discount based on its sales performance and whether it is already on sale. Check if the item is not selling_well and not already on_sale.
  3. Decide if the item should be discounted based on the overstock risk or its discount eligibility results. The makeDiscount boolean variable should become True if either overstockRisk or discountEligible is True.
  4. Print whether the item should be discounted based on the final combined condition - makeDiscount.

Task

You need to determine if a grocery item should be discounted based on its seasonal status, stock level, and sales performance.

  1. Use the predefined conditions to determine if an item is at risk of being overstocked by checking if it is seasonal and its stock exceeds a specific threshold. If the item is seasonal and the current_stock is greater than the high_stock_threshold, then the boolean variable overstockRisk should become True.
  2. Evaluate if an item is eligible for a discount based on its sales performance and whether it is already on sale. Check if the item is not selling_well and not already on_sale.
  3. Decide if the item should be discounted based on the overstock risk or its discount eligibility results. The makeDiscount boolean variable should become True if either overstockRisk or discountEligible is True.
  4. Print whether the item should be discounted based on the final combined condition - makeDiscount.

Switch to desktop for real-world practiceContinue from where you are using one of the options below

Everything was clear?

Section 3. Chapter 3
toggle bottom row

Challenge

Ready to put everything you've learned into practice? 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.

Let's dive in!

Task

You need to determine if a grocery item should be discounted based on its seasonal status, stock level, and sales performance.

  1. Use the predefined conditions to determine if an item is at risk of being overstocked by checking if it is seasonal and its stock exceeds a specific threshold. If the item is seasonal and the current_stock is greater than the high_stock_threshold, then the boolean variable overstockRisk should become True.
  2. Evaluate if an item is eligible for a discount based on its sales performance and whether it is already on sale. Check if the item is not selling_well and not already on_sale.
  3. Decide if the item should be discounted based on the overstock risk or its discount eligibility results. The makeDiscount boolean variable should become True if either overstockRisk or discountEligible is True.
  4. Print whether the item should be discounted based on the final combined condition - makeDiscount.

Task

You need to determine if a grocery item should be discounted based on its seasonal status, stock level, and sales performance.

  1. Use the predefined conditions to determine if an item is at risk of being overstocked by checking if it is seasonal and its stock exceeds a specific threshold. If the item is seasonal and the current_stock is greater than the high_stock_threshold, then the boolean variable overstockRisk should become True.
  2. Evaluate if an item is eligible for a discount based on its sales performance and whether it is already on sale. Check if the item is not selling_well and not already on_sale.
  3. Decide if the item should be discounted based on the overstock risk or its discount eligibility results. The makeDiscount boolean variable should become True if either overstockRisk or discountEligible is True.
  4. Print whether the item should be discounted based on the final combined condition - makeDiscount.

Switch to desktop for real-world practiceContinue from where you are using one of the options below

Everything was clear?

Ready to put everything you've learned into practice? 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.

Let's dive in!

Task

You need to determine if a grocery item should be discounted based on its seasonal status, stock level, and sales performance.

  1. Use the predefined conditions to determine if an item is at risk of being overstocked by checking if it is seasonal and its stock exceeds a specific threshold. If the item is seasonal and the current_stock is greater than the high_stock_threshold, then the boolean variable overstockRisk should become True.
  2. Evaluate if an item is eligible for a discount based on its sales performance and whether it is already on sale. Check if the item is not selling_well and not already on_sale.
  3. Decide if the item should be discounted based on the overstock risk or its discount eligibility results. The makeDiscount boolean variable should become True if either overstockRisk or discountEligible is True.
  4. Print whether the item should be discounted based on the final combined condition - makeDiscount.

Switch to desktop for real-world practiceContinue from where you are using one of the options below
Section 3. Chapter 3
Switch to desktop for real-world practiceContinue from where you are using one of the options below
We're sorry to hear that something went wrong. What happened?
some-alt