Instructions for snippetsTest

(produced at 10:03 a.m. on 2021-08-23)

Snippets Test Task

Instructions for the snippets test task.

This is markdown.

We can link to a rubric item and/or a snippet:

TODO: Highlight rubric items & examples when linking to them; add shiny to rubric links via JS!

Now

\

I'll

\

make

\

these

\

longer

\

so

\

the

\

rubric

\

get

\

pushed

\

down...

Examples

EXAMPLE and DATA variables

A simple example of what the input data might look like, and the slightly more complex DATA variable provided in the starter code.

In [ ]: EXAMPLE = [{'name': 'Two', 'order': 2}, {'name': 'One', 'order': 1}]

In [ ]: DATA = [{'name': 'A', 'order': 3},
 {'name': 'B', 'order': 2},
 {'name': 'C', 'order': 3},
 {'name': 'D', 'order': 1},
 {'name': 'E', 'order': 4}]

Example results

Some examples of what processData should return for various inputs, using the EXAMPLE and DATA variables shown above.

In [ ]: processData([{'name': 'Two', 'order': 2}, {'name': 'One', 'order': 1}], 1)

Out [ ]: ['One']

In [ ]: processData([{'name': 'Two', 'order': 2}, {'name': 'One', 'order': 1}], 2)

Out [ ]: ['One', 'Two']

In [ ]: processData([{'name': 'Two', 'order': 2}, {'name': 'One', 'order': 1}], 3)

Out [ ]: ['One', 'Two']

In [ ]: processData(
 [{'name': 'A', 'order': 3},
  {'name': 'B', 'order': 2},
  {'name': 'C', 'order': 3},
  {'name': 'D', 'order': 1},
  {'name': 'E', 'order': 4}],
 3
)

Out [ ]: ['D', 'B', 'A']

Full output example

An example of what the output should look like when your code is run. Note that the blue text shows what inputs were provided in this example.

In [ ]: %run process.py
A or B? A
D
A or B? B
D, B, A

Rubric

 
unknown Procedure Requirements
What code you use to solve the problem.
 
unknown Core goals
Complete all core goals for core credit. Get partial credit for completing at least half, and more partial credit for completing at least 90%.
 
unknown Define processData
Use def to define processData
 
unknown Call sorted
Within the definition of processData, call sorted in at least once place.
 
unknown Product Requirements
Your code's result values.
 
unknown Core goals
Complete all core goals for core credit. Get partial credit for completing at least half, and more partial credit for completing at least 90%.
 
unknown processData returns the correct result
The result returned when your processData function is run must match the solution result.
 
unknown Behavior Requirements
What your code does from the user's perspective.
 
unknown Extra goals
Complete all extra goals in addition to the core goals for a perfect score.
 
unknown Running process.py exhibits the correct behavior
When we run process.py as a whole file, the pattern of printed output based on inputs must match the solution's behavior.