I just started python with THONNY IDE.
I have a sample code for remove 'n' th character.
Tested it works fine, then i edit the code for remove 'x' and 'y' character, at that time i am getting error at Line No. 19.
can someone tell me, what is going wrong ?
I have a sample code for remove 'n' th character.
Tested it works fine, then i edit the code for remove 'x' and 'y' character, at that time i am getting error at Line No. 19.
can someone tell me, what is going wrong ?
# Python code to demonstrate # method to remove i'th character # Naive Method # Initializing String test_str = "electronics" # Printing original string print ("The original string is : " + test_str) # Removing char at pos 3 # using loop new_str = "" for i in range(0, len(test_str)): if i != 5: new_str = new_str + test_str[i] for i in range(0, len(new_str)) #error at this line if i != 7: new_str1 = new_str1 + new_str[i] new_str = new_str1 # Printing string after removal print ("The string after removal of i'th character : " + new_str)