need to print all rows

Question:

for row in rows[:5]:

This will give me the first 5 rows.
lets say I have a thousands rows – how can I print them all – what should I use between the square brackets ?

I am trying to print all rows but I am looking for something that will print the whole file regardless how big it is by default.

Asked By: Zaher el siddik

||

Answers:

You can just write

for row in rows:
    ...

no need to apply a slice

Answered By: Tom Wagg
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.