First error is invalid syntax: ';'
Second error about logic: in your exanple diff variable has boolean type so print("Went over by", abs(diff)) will always print 0 instead of number of characters.
The correct version of condition:
if (diff := tweet_limit - len(tweet_string)) >= 0:
Hello. I'm reading a traslated version of the book so I can't say on which page is following example but it contains two errors:
First error is invalid syntax: ';' Second error about logic: in your exanple diff variable has boolean type so
print("Went over by", abs(diff))
will always print0
instead of number of characters. The correct version of condition:https://stackoverflow.com/a/63876683/6188044