Collections

Collections is the process of pursuing payments that are significantly overdue. This can involve turning the account over to a collections agency. For freelancers, this is usually a last resort after attempting to collect the payment through reminders and discussions with the client.

What are collections in Python?

Collections are containers that are used to store collections of data, such as lists, dictionaries, and tuples. In Python, there are several built-in collections that provide different ways to store and manipulate data. These collections are designed to be efficient and easy to use, and they can be used to solve a wide range of programming problems.

What are some examples of built-in collections in Python?

Some examples of built-in collections in Python include:

  • List: A collection of elements that are ordered and changeable. Lists are written with square brackets.
  • Tuple: A collection of elements that are ordered and unchangeable. Tuples are written with parentheses.
  • Set: A collection of unique elements that are unordered and unindexed. Sets are written with curly braces.
  • Dictionary: A collection of key-value pairs that are unordered and changeable. Dictionaries are written with curly braces and colons.

How do I choose which collection to use for my data?

The choice of collection to use depends on the specific requirements of your program. Here are some general guidelines:

  • If you need to store an ordered collection of elements that can be changed, use a list.
  • If you need to store an ordered collection of elements that cannot be changed, use a tuple.
  • If you need to store a collection of unique elements and order is not important, use a set.
  • If you need to store a collection of key-value pairs and order is not important, use a dictionary.

How do I add or remove elements from a collection?

The methods for adding or removing elements from a collection depend on the specific type of collection. Here are some examples:

  • List: Use the append() method to add an element to the end of the list, and the remove() method to remove an element by value.
  • Tuple: Tuples are immutable, so you cannot add or remove elements. You can, however, create a new tuple with the desired elements.
  • Set: Use the add() method to add an element to the set, and the remove() method to remove an element by value.
  • Dictionary: Use the square bracket notation to add or update a key-value pair, and the del keyword to remove a key-value pair by key.

What is Workmade?

WorkMade is an all-in-one banking and accounting app designed specifically for freelancers! WorkMade gives you access to: zero-fee business banking, automated bookkeeping, fast and easy invoicing, and quarterly tax estimations and payments.

About Workmade
An artistic photograph of a freelancer getting paid

The banking app that pays your taxes, finds write-offs and gets you paid fast.

Free to download. Sign up in 60 seconds.

Learn More

Do your thing.

It only takes 60s to

Get Started

Scan to download the app.