Reputation: 41
have a scenario
df has 5 rows
for i in range(len(df)):
print ("\t", i, "Time")
need the output to look like
0 Time
1 Time
2 Time
3 Time
4 Time
How do we make python add the tabs depending on the counter value? Is there a way to do this?
Upvotes: 0
Views: 926
Reputation: 36
You could try multiplying of string which would give i no of tabs:
for i in range(len(df)):
print ("\t"*i, i, "Time")
Upvotes: 1