Back to marketplace

Structured Types

No description yet. This curated deck is ready for daily study.

Total cards: 11•Content version: v4•Public deck•Updated: 8/1/2026

Card preview (11)

#1
Front (Question)

Tubles

Back (Answer)

• an ordered sequence of elements • immutable • represented with parentheses

#2
Front (Question)

Tubles - more

Back (Answer)

• Swap variables (x, y) = (y, x) - Return more than one value from a function

#3
Front (Question)

Lists

Back (Answer)

• Ordered sequence of information • Denoted by square brackets • Contains a list of elements • Is mutable

#4
Front (Question)

Functions as Objects

Back (Answer)

first class objects: • have types • can be elements of data structures like lists • can appear in expressions • as part of an assignment statement • as an argument to a function! • useful to use functions as arguments when coupled with lists -> higher order programming (hop)

#5
Front (Question)

Generalization of HOPs

Back (Answer)

• Python provides a general purpose HOP -> map • simple form is a unary • general from is an n-ary

#6
Front (Question)

Dictionary

Back (Answer)

Store pairs of data: • key • value

#7
Front (Question)

Dictionary lookup

Back (Answer)

• similar to indexing into a list • looks up the key • returns the value associated with the key • if key not found -> error

#8
Front (Question)

Dictionary - values

Back (Answer)

• immutable and mutable • can be duplicates • can be lists, tuples, dictionaries

#9
Front (Question)

Dictionary - keys

Back (Answer)

• Unique • immutable • careful with using floats! • no order to keys or values!

#10
Front (Question)

list vs dictionary

Back (Answer)

lists: - ordered, look-up by int. index, indices have an order, index is an integer dict: - matches 'keys' to 'values' - look-up one item by another item - no order is guaranteed - key can be any immutable type

#11
Front (Question)

global variables

Back (Answer)

can be dangerous - breaks the scope - allows for side effects BUT can be convenient when want to keep track of information inside a function