Easy Tutorial
❮ Python Func Number Seed Ref Math Perm ❯

Python Remove Character at Specific Position in String

Python3 Examples

Given a string, remove the character at the specified position:

Example

test_str = "tutorialpro"

# Print the original string
print("The original string is : " + test_str)

# Remove the third character n
new_str = ""

for i in range(0, len(test_str)):
    if i != 2:
        new_str = new_str + test_str[i]

print("The string after removal is : " + new_str)

Executing the above code, the output is:

The original string is : tutorialpro
The string after removal is : Ruoob

Python3 Examples

❮ Python Func Number Seed Ref Math Perm ❯