print odd numbers of lines from tekst WITHOUT space between lines
TTaglo
tfente at gmail.com
Sat Feb 18 12:38:32 EST 2017
More information about the Python-list mailing list
Sat Feb 18 12:38:32 EST 2017
- Previous message (by thread): Crappy Python code of the day
- Next message (by thread): print odd numbers of lines from tekst WITHOUT space between lines
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
i = 1
f = open ('rosalind_ini5(1).txt')
for line in f.readlines():
if i % 2 == 0:
print line
i += 1
How do i get output without breaks between the lines?
Result:
Other things just make you swear and curse
When you're chewing on life's gristle, don't grumble give a whistle
This will help things turn out for the best
Always look on the bright side of life
- Previous message (by thread): Crappy Python code of the day
- Next message (by thread): print odd numbers of lines from tekst WITHOUT space between lines
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list