n="HELLO" # to choose how # many characters to keep # from left to right. # # n=n[:-len(n)+2] #------------------------ # to del last character, # you need to use negative # index n=n[:-1] print(n)
Create, edit, and import your Python scripts
n="HELLO" # to choose how # many characters to keep # from left to right. # # n=n[:-len(n)+2] #------------------------ # to del last character, # you need to use negative # index n=n[:-1] print(n)