6.11 Chapter Assessment

From Foundations of Python ProgrammingGNU FDL 1.3Original pagePython2 class periods7 exercises7 graded tests

README.md

6.11 Chapter Assessment

Read first in the book: 6.10 Exercises.

Check your understanding

Check your understanding: a multiple-choice question in the book.

Exercise 1

Write a program that extracts the last three items in the list sports and assigns it to the variable last. Make sure to write your code so that it works no matter how many items are in the list.

Open the 01 folder and edit main.py. Run Tests checks it.

Exercise 2

Write code that combines the following variables so that the sentence "You are doing a great job, keep it up!" is assigned to the variable message. Do not edit the values assigned to by, az, io, or qy.

Open the 02 folder and edit main.py. Run Tests checks it.

Check your understanding: a multiple-choice question in the book.

Check your understanding: a multiple-choice question in the book.

Check your understanding: a multiple-choice question in the book.

Check your understanding: a multiple-choice question in the book.

Check your understanding: a multiple-choice question in the book.

Exercise 3

Write code to determine how many 9's are in the list nums and assign that value to the variable how_many. Do not use a for loop to do this.

Open the 03 folder and edit main.py. Run Tests checks it.

Exercise 4

Write code that uses slicing to get rid of the the second 8 so that here are only two 8's in the list bound to the variable nums.

Open the 04 folder and edit main.py. Run Tests checks it.

Exercise 5

Assign the last element of lst to the variable end_elem. Do this so that it works no matter how long lst is.

Open the 05 folder and edit main.py. Run Tests checks it.

Exercise 6

Assign the number of elements in lst to the variable num_lst.

Open the 06 folder and edit main.py. Run Tests checks it.

Exercise 7

Create a variable called wrds and assign to it a list whose elements are the words in the string sent. Do not worry about punctuation.

Open the 07 folder and edit main.py. Run Tests checks it.

For teachers

6.11 Chapter Assessment

Students read Foundations of Python Programming's “Chapter Assessment” in CS Room and work through its 7 Python coding exercises (7 graded).

  • Time: 2 class periods
  • Tests: 7 in 7 graded exercises, set up for you when you import the lesson

Reading first

Exercises

FolderGradingTests
01Autograded1
02Autograded1
03Autograded1
04Autograded1
05Autograded1
06Autograded1
07Autograded1