Instantiate a dictionary in which the keys are the months in the third quarter of the year and the values are the number of days in the corresponding month. Display the dictionary, the keys, and the values. Add the tenth month of the year to the dictionary and display the value of that month only.

What will be an ideal response?


>>> days = {'July': 31, 'August': 31, 'September': 30}
>>> days
{'September': 30, 'July': 31, 'August': 31}
>>> days.keys()
['September', 'July', 'August']
>>> days.values()
[30, 31, 31]
>>> days['October'] = 31
>>> days['October']
31

Computer Science & Information Technology

You might also like to view...

Why are recursive functions an important tool in programming?

What will be an ideal response?

Computer Science & Information Technology

If a list box contains all numbers, then which of the following values can be calculated without using a loop?

(A) average value of the numbers (B) largest number (C) smallest number (D) number of numbers

Computer Science & Information Technology

Which of the following is a type of DoS attack?

A) Smurf attack B) SYN flood attack C) UDP flood attack D) All of the above

Computer Science & Information Technology

Method ______ returns a list of the lines in a file.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology