Ex - 6 Help Declaring bool variable


Need help with exercise 6. When declaring var hilarious as bool gives me a syntax error when I run the program. I am running python 3.6 on Ubuntu VM. I had review my code many times and still did not find any error… Maybe I am missing something, maybe is the python version on my machine.


Hello @divenguel

I just love to help people as much as I can because I also learn more from this.

To be able to help you with this, I (and others too) need to see your code.

Do like this:
Copy your code.

Paste your code in between those "code" words inside square brackets.

It will looks like this:

hilarious = True

I or someone else will soon help you with this problem.

1 Like

Welcome @divenguel !

Hello @ulfen69 and nellietobey

Thank you for your time. It just happen that I got it working after upgrading and shifting to python version 3.7 on mac. I just copied and pasted the exactly same script.

At the time I got the error, I was on Ubuntu VM on mac with python version 3.6

Now I am using:

mac Mojave version 10.14.3 with freshly upgraded python version 3.7 with Nano coding!

#This is the code for exercise 6 Learn Python the hardway

types_of_people = 10
x = f"There are {types_of_people} types of people."

binary = "binary"
do_not = "don't"
y = f"those who know {binary} and those who {do_not}."


print(f"i said: {x}")
print(f"I also said: '{y}'")

hilarious = False

joke_evaluation = "isn't that joke so funny?! {} "


w = "This is the left side of..."
e = "a string with a right side."

print(w + e)

I wonder if you were actually using Python 3.6 when you had that error. Either way, continue on and report any more errors, but in the future try to give us the code that’s causing it. Remember to do this:

# your code goes here

I edited your post and did this for you.