Write a Python function to Remove all duplicates from a given string


Topic: Write a Python function to Remove all duplicates from a given string

Solution

def removeDuplicate(str): 
    s=set(str) 
    s="".join(s) 
    print("Without Order:",s) 
    t="" 
    for i in str: 
        if(i in t): 
            pass
        else: 
            t=t+i 
    print("With Order:",t) 
    
str1="geeksforgeeks"
removeDuplicate(str1) 



List all Python Programs