Write a program to remove i-th indexed character from a string


Topic: Write a program to remove i-th indexed character from a string

Solution

  
def remove(string, i):  
  
    a = string[ : i]  
    b = string[i + 1: ] 
    return a + b 
     
if __name__ == '__main__': 
      
    string = "HellowWorld"
      
    # Remove nth index element 
    i = 5
    
    # Print the new string 
    print(remove(string, i)) 



List all Python Programs