-1

Im trying to run this python script in https://github.com/dayeol/telegram-keyword-detector python and I get a syntax error in line 40 of the code.

 File "telebot.py", line 40
    if chat_type <> "private":
                  ^
SyntaxError: invalid syntax

Anyone know how to fix this? Sorry for the formatting this is my first time asking a question here.

3
  • 3
    The syntax is != not <>
    – roganjosh
    Aug 30, 2020 at 20:08
  • 1
    if chat_type != "private":
    – balderman
    Aug 30, 2020 at 20:08
  • I'm curious now what version that could run in. I thought <> was ditched before it ever saw life :)
    – roganjosh
    Aug 30, 2020 at 20:09

1 Answer 1

0

The <> operator was available in Python 2, but was removed in Python 3. If you want to use this script in Python 3, you need to replace the <> operator with !=.

Not the answer you're looking for? Browse other questions tagged or ask your own question.