GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Python/strings/remove_duplicate.py at master · shitkoder/Python Expand file tree/ Copy pathremove_duplicate.pyMore file actions 15 lines (12 loc) · 434 Bytes / Copy pathremove_duplicate.pyFile metadata and controls15 lines (12 loc) · 434 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 def remove_duplicates(sentence: str) -> str: """ Remove duplicates from sentence >>> remove_duplicates("Python is great and Java is also great") 'Java Python also and great is' >>> remove_duplicates("Python is great and Java is also great") 'Java Python also and great is' """ return " ".join(sorted(set(sentence.split()))) if __name__ == "__main__": import doctest doctest.testmod() |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |