SyntaxFix
Write A Post
Hire A Developer
Questions
You could use this one-liner:
data = (data[:75] + '..') if len(data) > 75 else data