Python program to remove n’th character from string.

 

str = input ('Enter string: ')

n = int(input ('Enter index to remove character from string: '))

len = len(str)

if (n<len):

    x=''

    for i in range (len):

        ch = str[i]

        if (n!=i):

            x+= ch

    print ('New string: ',x)

Comments

Some popular posts

Python Program that computes the net amount of a bank account based a transaction log from console input.