Write a Python Program to Remove the Characters of Odd Index Values in a String


Topic: Write a Python Program to Remove the Characters of Odd Index Values in a String

Solution

def modify(string):  
    final = ""   
    for i in range(len(string)):  
        if i % 2 == 0:  
            final = final + string[i]  
    return final



List all Python Programs