0
1. Remove duplicate char from the string {'missyoupopaya'}
By use data type
9 odpowiedzi
+ 5
Sachin Pradhan ,
you have started with python core tutorial here in sololearn 7 days ago (11%). the question you are asking here, needs some more experience and knowledge to solve it.
so please be patient, don't move too fast forward in learning. it is better to go back some steps, repeat some lessons and do more practicing. then try it again.
happy coding and good success!
+ 3
Just traverse a string each time you need to check if this character is already present in set if not then insert it in set and also print it and if it is already present then just leave it
+ 3
Caste the type to set by set() function.
+ 2
Let <source> be a string variable contains "missyoupopaya"
Create an empty string variable name it <result>
For each character in <source> string,
If character isn't already in <result> string, then
Append character to <result>
Try to implement this in code 👍
+ 2
Pls know to me how to execute this question pls
+ 2
Tq so much dude...something learn from this❤️
+ 1
Post your code here
+ 1
If you tried to code this and got stuck, here is the code:
def removeDuplicates(str):
arr =[]
for i in range(len(str)):
if(str[i] not in arr):
arr.append(str[i])
print("".join(arr))
removeDuplicates("missypopaya")
Cheers✌
0
I don't know how to solve, i have this doubt, the string is {'missyoupopaya'}. duplicate character will remove. Mean the output will come {misyoupa}. All double triple char become remove.