Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Oppiskele Haaste: Käyttöoikeuden ja Etujen Tarkistin | Boolenit ja Vertailut
Tietotyypit Pythonissa

bookHaaste: Käyttöoikeuden ja Etujen Tarkistin

Tehtävä

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.

Ratkaisu

Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 2. Luku 5
single

single

Kysy tekoälyä

expand

Kysy tekoälyä

ChatGPT

Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme

close

bookHaaste: Käyttöoikeuden ja Etujen Tarkistin

Pyyhkäise näyttääksesi valikon

Tehtävä

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.

Ratkaisu

Switch to desktopVaihda työpöytään todellista harjoitusta vartenJatka siitä, missä olet käyttämällä jotakin alla olevista vaihtoehdoista
Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 2. Luku 5
single

single

some-alt