Skip to main content
Contents Index
Search Book
Search Results:
No results.
Read aloud
Readability settings Prev Up Next Scratch ActiveCode Profile
title here
\(
\newcommand{\lt}{<}
\newcommand{\gt}{>}
\newcommand{\amp}{&}
\definecolor{fillinmathshade}{gray}{0.9}
\newcommand{\fillinmath}[1]{\mathchoice{\colorbox{fillinmathshade}{$\displaystyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\textstyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\scriptstyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\scriptscriptstyle\phantom{\,#1\,}$}}}
\)
Section 3.7 Lists Coding Practice Exercises
This section contains coding practice exercises using lists. Some of these are adapted from the AP CSP and Python for Everybody ebooks by Dr. Barb Ericson.
Activity 3.7.1 .
Write code to change the first item in the list
weekdays to βMondayβ, and append βFridayβ to the end of the list.
Activity 3.7.2 .
Write code to change the first item in the list
months to βFebruaryβ, to insert βAprilβ between βMarchβ and βMayβ, and to remove βAugustβ.
Activity 3.7.3 .
Write code that uses a for loop to traverse the list
numbers and prints out 10 times each number.
Activity 3.7.4 .
Write code that uses a for loop to go through a list of words and print out the first letter of each word to form an acronym.
Activity 3.7.5 .
Write code that uses a for loop to go through a list of temperatures and counts how many days were below freezing (32 degrees).
Activity 3.7.6 .
Write code that uses a for loop to go through a list of words and prints out any words that have the substring "cat" in them.
You have attempted
of
activities on this page.