Skip to main content

Section 12.7 Drill and Practice

Checkpoint 12.7.1.

The variable nested contains a nested list. Assign β€˜snake’ to the variable output using indexing.

Checkpoint 12.7.2.

Below, a list of lists is provided. Use in and not in tests to create variables with Boolean values. See comments for further instructions.

Checkpoint 12.7.3.

Below, we’ve provided a list of lists. Use in statements to create variables with Boolean values - see the ActiveCode window for further directions.

Checkpoint 12.7.4.

Iterate through the contents of l_of_l and assign the third element of sublist to a new list called third.

Checkpoint 12.7.5.

Given below is a list of lists of athletes. Create a list, t, that saves only the athlete’s name if it contains the letter β€œt”. If it does not contain the letter β€œt”, save the athlete name into list other.
You have attempted of activities on this page.