Close
Close Window

Demo Exercises from Pitt-Acos

Chapter 2 Python Parsons Problems

Show Source |    | About   «  2.2. jsParsons Python 2   ::   Contents   ::   2.4. jsParsons Python 4  »

2.3. jsParsons Python 3

2.3.1. About

Parson's problems in Python.

2.3.2. ps_python_list_iteration_zoo

Construct a program that prints out all the animals in the zoo-variable by looping through the list.

2.3.3. ps_python_nested_lists_indexing

Construct a program that first prints out [[1, 2, 3], [4, 5, 6]], then [4, 5, 6], and finally 6 from the nested list.

2.3.4. ps_python_string_indexing

Construct a program that first prints out strings "Py", "th", "o", and "n" from the "Python" string.

2.3.5. ps_python_dict_keys

“storage” dictionary object stores the amount of certain items in storage. Construct a program that prints out a list of all the items that are more than one currently stored.

2.3.6. ps_python_dict_values

Construct a program that loop through the dictionary and prints out how many items in total are in storage.

2.3.7. ps_python_list_to_dict

Construct a program that casts list to dictionary and prints out moo and oink, in that order.

   «  2.2. jsParsons Python 2   ::   Contents   ::   2.4. jsParsons Python 4  »

nsf
Close Window