Stuck on Python!


#1



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


File "python", line 13
bool_four = 4<5 not "Charlie" == "Bravo"
^
SyntaxError: invalid syntax


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 or 3==2

Make me false!

bool_three = 2<1 and 3<2

Make me true!

bool_four = 4<5 not "Charlie" == "Bravo"

Make me true!

bool_five = 4==4


Replace this line with your code.


#2

It would seem that you have used not improperly. Lets revisit not. "The boolean operator not returns True for false statements and False for true statements." (from Lesson 8. Not) Examples: not False will evaluate to True, while not 41 > 40 will return False. Notice how not is used. While or and and can combine or be conjunctions between sets of numbers or expressions or equations not has to be associated with a word or expression and put before that word or expression. In your case, while you have not before "Charlie" you have nothing between 4<5 and "Charlie". The correct way to format this would be like this below:

bool_four = not "Charlie" == "Bravo" and 4<5

#3

I'll keep practicing not, thanks :slight_smile:


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.