Advertisement
maynul67

remove duplicates from a string

Jul 10th, 2021
649
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.11 KB | None | 0 0
  1. str = "I am inevitable"
  2.  
  3. result = ''
  4.  
  5. for char in str:
  6.     if char not in result:
  7.         result += char
  8.  
  9.  
  10. print(result)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement