Reputation: 11
for seqA in poolA:
print seqA + ":",
for i in seqA:
print complements[i],
print
complements
is a dict
and poolA
is a list
.
When I print complements[i]
there are spaces in between, how do I remove these spaces?
Upvotes: 1
Views: 74
Reputation: 129904
Well, just don't print them out. Use either from __future__ import print_function
and then print(complements[i], end = '')
, or sys.stdout.write(complements[i])
.
Upvotes: 2
Reputation: 67010
Join the items and print the resulting string.
print ''.join(str(complements[i]) for i in seqA)
Upvotes: 5