Answer:
jellybeans = 10
licorice = 35
delicious = (jellybeans > 20) or (licorice > 30) or ((jellybeans + licorice) > 40)
print(delicious)
Explanation:
*The code is in Python.
Set the jellybeans and licorice to any values you like
In order to have the value of True or False without using the if statement, we need to set delicious as boolean variable. As you may know, boolean variables are the variables that have a value of either True or False
Check if jellybeans is greater than 20 or not → (jellybeans > 20)
Check if licorice is greater than 30 or not → (licorice > 30)
Check if their sum is greater than 40 or not → ((jellybeans + licorice) > 40)
All of the above expressions are boolean expressions. They return True if the statement is correct. Otherwise, they return False
Also, note that we combined all the expressions with or
For these values → jellybeans = 10, licorice = 35:
The first statement returns False
The second statement returns True
The third statement returns True
delicious = False or True or True → True
Note that if the expressions are combined with or, the result will be True if one of the expression is True.