S
seafoid
Hi Guys,
When python reads in a file, can lines be referred to via an index?
Example:
for line in file:
if line[0] == '0':
a.write(line)
This works, however, I am unsure if line[0] refers only to the first line or
the first character in all lines.
Is there an easy way to refer to a line with the first character being a
single letter that you know?
Thanks in advance,
Seafoid.
When python reads in a file, can lines be referred to via an index?
Example:
for line in file:
if line[0] == '0':
a.write(line)
This works, however, I am unsure if line[0] refers only to the first line or
the first character in all lines.
Is there an easy way to refer to a line with the first character being a
single letter that you know?
Thanks in advance,
Seafoid.