Python Tip #15 (of 365):

Don't forget about slicing!

To get all command-line args but the first, you COULD do this:
import sys
arguments = list(sys.argv)
arguments.pop(0)

But slicing is better for "get all but the first":
import sys
arguments = sys.argv[1:]

Slicing is commonly used to...

Get the first few:
first3 = items[:3]

Get the last few (note the negative):
last3 = items[-3:]

Exclude first or last:
all_but_first = items[1:]
all_but_last = items[:-1]

๐Ÿงต(1/2)

0

If you have a fediverse account, you can quote this note from your own instance. Search https://mastodon.social/users/treyhunner/statuses/115900734615452886 on your instance and quote it. (Note that quoting is not supported in Mastodon.)