Subtract one list from another list

I provision subnets in all availability zones.
I want a user to specify one or more availability zones to skip.

This seems like a use case for:
This is an example of when you have single known item you want to remove from a list:

Thoughts on how to remove all items in one list from another list? Is there documentation in what language the for is written in? Can I do two loops? Anything more efficient?

Anyone have any thoughts on how to accomplish this?

Hi @throwaway8787!

We can generalize the idea I shared in that issue with any other condition, including a call to contains:

  example = [
    for x in var.any_list : x if !contains(var.to_remove, x)