Python is a popular test-automation language thanks to its readable syntax, huge ecosystem (pytest, Selenium, requests, Playwright), and low boilerplate. Its core built-in types are int, float, str, bool, list, tuple, dict, and set.
Python's concise syntax lets testers write and maintain suites quickly, and libraries like pytest (test runner), Selenium/Playwright (browser), requests (API), and pandas (data) cover the whole QA stack. The core data types split into immutable (int, float, str, tuple, frozenset) and mutable (list, dict, set). Choosing the right type matters: lists for ordered mutable sequences, tuples for fixed records, dicts for key-value lookups (O(1)), and sets for uniqueness/membership tests. Everything in Python is an object, and variables are references to objects.
A tester picks a dict to map test-case ids to expected results for O(1) lookup, a list for an ordered set of steps, and a set to assert that returned ids are unique — each type chosen for its strength.
You need to check whether 10,000 returned user ids are all unique and whether a specific id is present. Which data type and why?