I have a file that contains a String and i want to search for a substring in a specific range, This is my string:
newick;
((raccoon,bear),((sea_lion, seal),((monkey,cat), weasel)),dog);
And this is my code for it:
def removeNewick(tree):
for x in tree:
new_set = x.replace('newick;', '')
print(new_set)
filepath = "C:\\Users\\msi gaming\\Desktop\\small_tree.tre"
tree = open(filepath)
removeNewick(tree)
But i know for sure that if this string 'newick' is going to appear, then it would be in the first 10 characters of the string so how do i edit my for loop only to loop over the first ten characters?