Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprende Challenge: Boolean Logic | Section
Python Basics for Data Analysis
Sección 1. Capítulo 13
single

single

bookChallenge: Boolean Logic

Desliza para mostrar el menú

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.

Tarea

Swipe to start coding

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>.

Solución

Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 1. Capítulo 13
single

single

Pregunte a AI

expand

Pregunte a AI

ChatGPT

Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla

some-alt