CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-us

A package for easily working with US and state metadata

Overall
score

88%

Overview
Eval results
Files

task.mdevals/scenario-7/

US State Analysis Tool

A command-line utility that analyzes and reports on US states and territories based on user-specified criteria.

Capabilities

List all states

  • It lists all 50 US states when requested @test
  • It displays only state names in the output @test

List all territories

  • It lists all US territories when requested @test
  • It displays only territory names in the output @test

Provide combined counts

  • It reports the total count of states and territories combined @test

Requirements

Create a module that provides the following functionality:

  1. A function list_states() that returns a list of all US state names (should return exactly 50 states)
  2. A function list_territories() that returns a list of all US territory names (should return exactly 5 territories)
  3. A function count_all() that returns the total number of states and territories combined (should return 55)

All functions should return the results in a consistent format (lists of strings for names, integers for counts).

Implementation

@generates

API

def list_states():
    """
    Returns a list of all US state names.

    Returns:
        list: A list of strings containing all US state names
    """
    pass

def list_territories():
    """
    Returns a list of all US territory names.

    Returns:
        list: A list of strings containing all US territory names
    """
    pass

def count_all():
    """
    Returns the total count of US states and territories.

    Returns:
        int: The total number of states and territories
    """
    pass

Dependencies { .dependencies }

us { .dependency }

A Python library for working with US state and territory metadata.

Install with Tessl CLI

npx tessl i tessl/pypi-us

tile.json