pyTony
pyMod
6,299 posts since Apr 2010
Reputation Points: 879
Solved Threads: 984
Skill Endorsements: 26
Doesn't the
print align[:,3:11]
work?
pyTony
pyMod
6,299 posts since Apr 2010
Reputation Points: 879
Solved Threads: 984
Skill Endorsements: 26
maybe you can line.split(None, 1)[0] to get rid of last word in each line, but there must be a proper way also.
data = """
AAAACGT Alpha
AAA-CGT Beta
AAAAGGT Gamma""".splitlines()
print('\n'.join(line.split(None, 1)[0] for line in data if ' ' in line))
pyTony
pyMod
6,299 posts since Apr 2010
Reputation Points: 879
Solved Threads: 984
Skill Endorsements: 26