Lecture 8 Exercises¶
The dictionary
Junior
shows a schedule for a junior year semester. The key is the course name and the value is the number of credits. Find the total number of credits taken this semester and assign it to the variable credits
. Do not hardcode this – use dictionary accumulation!
Create a dictionary,
freq
, that displays each letter in string str1
as the key and the number of times it occurs in the string as the value.