Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Challenge: Access and Perks Checker | Booleans and Comparisons
Data Types in Python

bookChallenge: Access and Perks Checker

Oppgave

Swipe to start coding

You're validating user access and perks during checkout. All inputs are pre-initialized. Do not change them. Fill in the expressions to compute the results below using only variables, operators (==, !=, <, <=, >, >=, and, or, not), and parentheses.

Compute:

  1. is_adult: user is at least the adult age.

  2. can_enter: user can enter only if they have ID and are an adult.

  3. qualifies_free_shipping: qualifies if the purchase total meets the free-shipping threshold or the user is a member.

  4. eligible_discount:

    • Members: discount if purchase_total >= member_min_spend
    • Non-members: discount if purchase_total >= guest_min_spend
  5. needs_manual_review: review is needed if email is not verified or phone is not verified.

  6. valid_score_range: the score is within inclusive bounds using chained comparison.

Løsning

Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 2. Kapittel 5
single

single

Spør AI

expand

Spør AI

ChatGPT

Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår

close

Awesome!

Completion rate improved to 5

bookChallenge: Access and Perks Checker

Sveip for å vise menyen

Oppgave

Swipe to start coding

You're validating user access and perks during checkout. All inputs are pre-initialized. Do not change them. Fill in the expressions to compute the results below using only variables, operators (==, !=, <, <=, >, >=, and, or, not), and parentheses.

Compute:

  1. is_adult: user is at least the adult age.

  2. can_enter: user can enter only if they have ID and are an adult.

  3. qualifies_free_shipping: qualifies if the purchase total meets the free-shipping threshold or the user is a member.

  4. eligible_discount:

    • Members: discount if purchase_total >= member_min_spend
    • Non-members: discount if purchase_total >= guest_min_spend
  5. needs_manual_review: review is needed if email is not verified or phone is not verified.

  6. valid_score_range: the score is within inclusive bounds using chained comparison.

Løsning

Switch to desktopBytt til skrivebordet for virkelighetspraksisFortsett der du er med et av alternativene nedenfor
Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

close

Awesome!

Completion rate improved to 5
Seksjon 2. Kapittel 5
single

single

some-alt