Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+4 votes

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

asked in CSC201 Spring 2021 by (1 point)

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 (1 point)
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 (4k points)
...