pythonpython-3.xlist

How to print list of strings but skip the first item / jump to the second item?


This is my simple python code:

fruits1 = ["banana","avocado","grape","orange","strawberry"]
for a in fruits1:
    print(a)

If we do print(a) normally, the output would be like this:

banana
avocado
grape
orange
strawberry

How to make the output result like this:

avocado
grape
orange
strawberry

I want to "jump" to the second item and print "avocado" as the first result?


Solution

  • Try this :

    for a in fruits1[1:]:
     print(a)