Mix 'n' Match


#1

My syntax is as follows. Please advise.

# 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 != 5) or (5 > 2) 

# Make me false!
bool_three = not (10 <= 2) (10 > 2)

# Make me true!
bool_four = (2 == 2) and "Asian" == "Smart" 

# Make me true!
bool_five = (5*2 == 25) or (25 == 5*2)

#2

Hi there. FYI, I edited your post in order to make the code formatted correctly.

What is the problem you're having with this code?


#3

Here is my revised code syntax. However, when I run the code, it comes up with syntactical errors for needed characters in the code. Please advise.

# 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 != 5) or (5 > 2) 

# Make me false!
bool_three = (10 < 2) not (5 > 10)

# Make me true!
bool_four = (2 == 2) and "Asian" != "Smart" 

# Make me true!
bool_five = (5**2 == 25) or (25 == 5**2)

#4

bool_three will come out as true.

As for needed characters in the code -- what do you mean?


#5

I think that that bool_three = (10 < 2) not (2 < 10) now will come out "False." Please advise. Thanks!

Sincerely,

Ian Michael Jones


#6

After I run the code it continues to run. How do I go about fixing this problem? Thanks!

Sincerely,

Ian Michael Jones


#7
 Here is my new syntax.  Please advise.  Thanks!

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 != 5) or (5 > 2)

Make me false!

bool_three = (10 < 2) not (2 != 10)

Make me true!

bool_four = (2 == 2) and "Asian" != "Smart"

Make me true!

bool_five = (5**2 == 25) or (25 == 5**2)

Sincerely,

Ian Michael Jones


#8

Confused:

Make me false!

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

Make me true!

bool_two = (2 == 2) and "Go" == "Go"

Make me false!

bool_three = not 5 == 5 "My" == "My"

Make me true!

bool_four = 6 == 6 or False

Make me true!

bool_five = (1 == 1) and "Hi" == "Hi"


#9

Here is my new syntax. Please advise. Thanks!
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 != 5) or (5 > 2)

Make me false!
bool_three = (10 < 2) not (2 != 10)

Make me true!
bool_four = (2 == 2) and "Asian" != "Smart"

Make me true!
bool_five = (5**2 == 25) or (25 == 5**2)

Sincerely,

Ian Michael Jones


#10

hi there-

I figured out what was wrong with your code. You just had to add some comparators. Here is the correct solution.

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 != 5) or (5 > 2)

Make me false!

bool_three = not (10 < 2) and (5 > 10)

Make me true!

bool_four = (2 == 2) and "Asian" != "Smart"

Make me true!

bool_five = (5**2 == 25) or (25 == 5**2)


#11

Thanks camclarke2000!