You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered: