Another approach, throwing out the "no other data structures" rule, is to strip the string down to letters-only, convert to a set, and compare lengths:
defunique_only(s):s=''.join(c.lower()forcinsifc.isalpha())returnlen(set(s))==len(s)unique_only("My and his bot")# True
unique_only("These are some words")# False
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.
Another approach, throwing out the "no other data structures" rule, is to strip the string down to letters-only, convert to a set, and compare lengths: