1. Remove duplicate char from the string {'missyoupopaya'} | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

1. Remove duplicate char from the string {'missyoupopaya'}

By use data type

18th May 2021, 11:49 AM
Sachin Pradhan
Sachin Pradhan - avatar
9 Respostas
+ 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!
18th May 2021, 1:31 PM
Lothar
Lothar - avatar
+ 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
18th May 2021, 12:13 PM
YUGRAJ
+ 3
Caste the type to set by set() function.
18th May 2021, 12:28 PM
TOLUENE
TOLUENE - avatar
+ 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 šŸ‘
18th May 2021, 12:54 PM
Ipang
+ 2
Pls know to me how to execute this question pls
18th May 2021, 2:18 PM
Sachin Pradhan
Sachin Pradhan - avatar
+ 2
Tq so much dude...something learn from thisā¤ļø
19th May 2021, 4:55 PM
Sachin Pradhan
Sachin Pradhan - avatar
+ 1
Post your code here
18th May 2021, 11:51 AM
Atul [Inactive]
+ 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āœŒ
19th May 2021, 10:58 AM
Isaac Fernandes
Isaac Fernandes - avatar
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.
18th May 2021, 11:58 AM
Sachin Pradhan
Sachin Pradhan - avatar