I am working on a lesson from Udacity, and I have a problem trying to figure out if the result from this site returns true or false. I get a TypeError with the code below.
from urllib.request import urlopen #check text for curse words def check_profanity(): f = urlopen("http://www.wdylike.appspot.com/?q=shit") output = f.read() f.close() print(output) if "b'true'" in output: print("There is a profane word in the document") check_profanity()
The output is b'true' , and I'm not sure where this' b' comes from.
source share