Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Apprendre Défi : Vérificateur d'Accès et d'Avantages | Booléens et Comparaisons
Types de Données en Python

bookDéfi : Vérificateur d'Accès et d'Avantages

Tâche

Swipe to start coding

You're checking simple user conditions during checkout. All input variables are already defined - do not change them. Use only comparison and logical operators: ==, !=, <, <=, >, >=, and, or, not, and parentheses.

Compute:

  1. is_adult — the user is at least adult_age.
  2. can_enter — the user can enter if they are an adult and have an ID.
  3. qualifies_free_shipping — true if purchase_total meets the free_shipping_threshold or the user is a member.
  4. needs_manual_review — true if email or phone is not verified.
  5. valid_score_range — the score is within the range [min_score, max_score] using a chained comparison.

Finally, print all five results in one line.

Solution

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 2. Chapitre 5
single

single

Demandez à l'IA

expand

Demandez à l'IA

ChatGPT

Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion

Suggested prompts:

Can you explain this in simpler terms?

What are some examples related to this topic?

Where can I learn more about this?

close

bookDéfi : Vérificateur d'Accès et d'Avantages

Glissez pour afficher le menu

Tâche

Swipe to start coding

You're checking simple user conditions during checkout. All input variables are already defined - do not change them. Use only comparison and logical operators: ==, !=, <, <=, >, >=, and, or, not, and parentheses.

Compute:

  1. is_adult — the user is at least adult_age.
  2. can_enter — the user can enter if they are an adult and have an ID.
  3. qualifies_free_shipping — true if purchase_total meets the free_shipping_threshold or the user is a member.
  4. needs_manual_review — true if email or phone is not verified.
  5. valid_score_range — the score is within the range [min_score, max_score] using a chained comparison.

Finally, print all five results in one line.

Solution

Switch to desktopPassez à un bureau pour une pratique réelleContinuez d'où vous êtes en utilisant l'une des options ci-dessous
Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 2. Chapitre 5
single

single

some-alt