168k views
2 votes
What will the following code display? dct = {'January':1, 'February':2, 'March':3} print(dct['February'])​

1 Answer

2 votes

Answer:

The code will display 2.

Step-by-step explanation:

dct is a dictionary with 3 indexes; January, February, and March. print(dct['February']) gets the value at index 'February', which is 2, as shown in the initialization of dct.

User Robin Rieger
by
7.9k points

No related questions found