Programs for practice
In the program below, we used the arithmetic addition operator (%) to find even or odd number.
Source Code: PROGRAM TO REMOVE THE NTH INDEX CHARACTER FROM A NON-EMPTY STRING
# PROGRAM TO REMOVE THE NTH INDEX CHARACTER FROM A NON-EMPTY STRING string=input("Enter the string:") n=int(input("Enter the index of the character to remove:")) first = string[:n] last = string[n+1:] print("Modified string:",first+last)
OutputEnter the string:we123 Enter the index of the character to remove:1 Modified string: w123