Skip to article frontmatterSkip to article content

Exercise 4 - Composite Data Types

5 total points

Directions

  • Due: 9/28/2025 @ 11:59 p.m.
  • Change the name of your notebook to EX4_FirstLast.ipynb, where First is your first name and Last is your last name.
  • For each of the following prompts, write or modify Python code that fulfills the requirements.

Important information to remember

  • Periodically, you should click File -> Save Notebook
  • When you are done working for the day, click File -> Log Out
  • When you are finished, download the notebook and upload it to the submission link
  • I will reset the notebook and run each code block on its own. You will receive half credit if you rely on a variable from a previous or subsequent code block.

Setting variables to composite data types

Problem 1

Set a variable named a to a string (0.5 pts)

Problem 2

Set a variable named b to a tuple (0.5 pts)

Problem 3

Set a variable named c to a list (0.5 pts)

Problem 4

Set a variable named d to a tuple of 3 floats named fa fb fc (0.5 pts)

Problem 5

Set a variable named e to a list of 3 strings named sa sb sc (0.5 pts)

Problem 6

Set a variable named f to a dictionary that has a string as an index for a list of 3 integers named ia ib ic (0.5 pts)

Problem 7

Set a variable named g to a dictionary that has 3 string indexes, and each index has a list with three values in them.

One list has 3 strings named sa sb sc one list has 3 floats named fa fb fc , and one list has 3 booleans named ba bb bc (1 pt)

Problem 8

Create a dictionary named observation that has 2 indexes for 2 lists. The indexes should be named high temperature and low temperature (0.5 pts)

The list associated with high temperature should have two integers named ia ib that are larger than those associated with low temperature (0.25 pts)

The list associated with low temperature should have two integers named ic id that are smaller than those associated with high temperature (0.25 pts)