Remove duplicates in a string

Write a function remove_duplicates that takes a string and returns a new string with duplicate characters removed, keeping the first occurrence of each character.
def remove_duplicates(str):
# complete function here...
print(remove_duplicates('banana')) # expected output: 'ban' print(remove_duplicates('vegetable')) # expected output: 'vegtabl' print(remove_duplicates('difficulty')) # expected output: 'difculty'
Python
Setting up Python environment...
Output