[Tutor] Conditional Statement without if statement?

Susana lists at linguarum.net
Tue Feb 8 04:57:48 EST 2022


Hi Barret,

you need to use combinations of relational operators (ex. >, <=, etc) and logical operators (and, or...).

Greetings.

Barrett Ferguson escreveu:
> Hello,
> 
>  I have an assignment which asks me to create an if statement without using if, pls help. :)
> I have attached the complete question
> 
> Write code that sets the value of a variable named delicious to True if jellybeans is greater than 20, or licorice is greater than 30, or their sum is greater than 40. Otherwise, set it to False. Do NOT use an if statement in your solution. Assume jellybeans and licorice already have values.
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor

-- 
Susana Sotelo Docío                                  gpg-id: 0E9BEDA4


More information about the Tutor mailing list