Hello , Im stuck with this code and cant get around it . It's the mix and match section in Boolean Operators system


#1

Use boolean expressions as appropriate on the lines below!

Make me false!

bool_one = (2 <= 2) and "Alpha" == "Bravo" # We did this one for you!

Make me true!

bool_two = (2 <= 2) and "2" == "True"

Make me false!

bool_three = (2 <= 2) and "Alpha" == "False"

Make me true!

bool_four = (18 <= 9*2) and "9*2" == "True"

Make me true!

bool_five = (6 <= 6) and "6" == "True"

https://www.codecademy.com/en/courses/python-beginner-BxUFN/2/6?curriculum_id=4f89dab3d788890003000096#


#2

Well it says to do as in the comment. For instance, or will always return True if one is True so just play around with it like below.

Use boolean expressions as appropriate on the lines below!

# Make me false!
bool_one = (2 <= 2) and "Alpha" == "Bravo"  # We did this one for you!

# Make me true!
bool_two =  True or True

# Make me false!
bool_three = False and not False

# Make me true!
bool_four = 10**2 == 100 and 2 != 3

# Make me true!
bool_five = 15*2 == 30 and 2*2 == 4

#3

Thanks alot , can you tell me the definition of == .. wouldn't one "=" solve it


#4

= is an assignment sign. it assigns something to something. for example, x =2. You assign x with the value 2.
But == means "equal to". like:

4/2 == 2.

Just take as a rough idea: You compare two values and use == (both side of == are values). You assign value normally to a variable. (one is variable = one is value)


#5

@mashuk Has done justice to that.

= is for assignment.
== is for equating and comparing of values
=== is for comparing of values and data-types (string, boolean...)

Hope I still helped! :smile:


#6

That's cool! :sunglasses:


#7

You're welcome.

Have fun coding! :smile:


#8

You too. Keep learning!:relaxed: