← Lesson
Tuples and Sets
Joeven
Run
Reset
Python loads on first run
pair = ("search", "weather nyc") tool, args = pair print("tool:", tool) print("args:", args) print("pair unchanged:", pair) raw = ["search", "read", "search", "write", "read"] unique = set(raw) print("unique names:", sorted(unique)) allowed = {"search", "read"} print("write allowed?", "write" in allowed) print("search allowed?", "search" in allowed) print("blocked:", sorted(set(raw) - allowed)) print("empty set type:", type(set())) print("empty {} type:", type({}))
Run to execute this in your browser. Nothing is sent to a server.