1mylist = []
2# Assuming that you have loaded data into a lines variable.
3for line in lines:
4 mylist.append(line.strip().split('\t')
1example_string = "Hello there"
2
3def remove_chars(n, string):
4 list_of_chars_in_string = [char for char in string]
5
6 for num in range(n):
7 list_of_chars_in_string.pop() # Removes last n characters in string
8
9 new_string = ''.join(list_of_chars_in_string)
10 return new_string