If in statement error

0 James Kon · October 5, 2015
I am using Python 3, I am currently working on a project that needs me to view a variable and check if a certain word is in it.

Ex:
x = "Hello, how are you?"

if "Hello" in x:
print("Found!")


However, once ran I seem to get an error. Here is the error it gives me:
TypeError: a bytes-like object is required, not 'str'

Any help is greatly appreciated.

Post a Reply

Replies

Oldest  Newest  Rating
  • 1

Python

106,995 followers
About

This section is all about snakes! Just kidding.

Links
Moderators
Bucky Roberts Administrator