fromtypingimportListdeflikes(names:List[str])->str:messages={0:'no one likes this',1:'%s likes this',2:'%s and %s like this',3:'%s, %s and %s like this'}message=messages.get(len(names))ifnotmessage:return'%s, %s and %d others like this'%(*names[:2],len(names)-2)returnmessage%tuple(names)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Here's my version :)