Welcome to the CSC Q&A.
Get help and give help!
Write great code!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+3 votes

Hey guys, how can we access a month in the complaiDict? Thank you

asked in CSC201 Spring 2021 by (3.4k points)

2 Answers

+1 vote

For the month you are trying to check you should get the key which is the date from the dictionary. Then edit the date by using slash index and split or other methods to get the first number which is the month.
Hope that helps

answered by (5.8k points)
0 votes

First, get the whole date using the date received key.

That date is a string.

The month is everything up until the first '/'.

You can either split the string using the / separator and take the first chunk, or you can find the index of the '/' character and use slicing to get from character 0 up to that index.

answered by (14.2k points)
...