The task i recieved :
Examples of running the sequence_del function :
>>> sequence_del("ppyyyyythhhhhooonnnnn")
'python'
>>> sequence_del("SSSSsssshhhh")
'Ssh'
>>> sequence_del("Heeyyy yyouuuu!!!")
'Hey you!'
The code I wrote :
def sequence_del(my_str): # the function deletes duplicated characters.
l = []
for ch in my_str:
if ch not in l:
l.append(ch)
print("".join(l))
For some reason i can't think of a way to cover the 3rd example in the task . Would love some help with it !