Apr-14-2018, 03:03 AM
If your intention is to go through first three list items you can do it like this:
l1 = ['hello', 'bye', 'now', 'before', 'after'] for word in l1[0:3]: print(word)