8.14

9 From Pyret to Python🔗

    9.1 From Pyret to Python

      9.1.1 Expressions, Functions, and Types

      9.1.2 Returning Values from Functions

      9.1.3 Examples and Test Cases

      9.1.4 An Aside on Numbers

      9.1.5 Conditionals

      9.1.6 Creating and Processing Lists

        9.1.6.1 Filters, Maps, and Friends

      9.1.7 Data with Components

        9.1.7.1 Accessing Fields within Dataclasses

      9.1.8 Traversing Lists

        9.1.8.1 Introducing For Loops

        9.1.8.2 An Aside on Order of Processing List Elements

        9.1.8.3 Using For Loops in Functions that Produce Lists

        9.1.8.4 Summary: The List-Processing Template for Python

    9.2 Dictionaries

      9.2.1 Creating and Using a Dictionary

      9.2.2 Searching Through the Values in a Dictionary

      9.2.3 Dictionaries with More Complex Values

      9.2.4 Dictionaries versus Dataclasses

        Summary

    9.3 Arrays

      9.3.1 Two Memory Layouts for Ordered Items

      9.3.2 Iterating Partly through an Ordered Datum