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
Post a Comment