DEV Community 👩‍💻👨‍💻

Discussion on: Solving the Problem Sets of CS50's Introduction to Programming with Python — One at a Time: Problem Set 3

rivea0 profile image
Eda Author

Hello Gebhard,

It seems that has an issue with notifications for comments on original content, I haven't seen yours until I have just encountered it, I really apologize for the inconvenience of the delay.

You've probably already had an answer to your question by now, but I still wanted to reply.

I don't think there is any need to convert the variables to integers while splitting. A simple conditional was enough in my solution to check if the values were not out of range, and since the output was going to be a string, you could just
convert them to integers for the conditional, with something like if 0 < int(day) < 32 and 0 < int(month) < 13. I don't think it would require raising an exception here, we could just raise a ValueError for the input itself if it was faulty.

Again, I apologize for the long-delayed response, hope you're doing well.

aristhera profile image

Hi Eda, yes I know that, happens to me all the time (overlooking messages). Don't worry about it, hope you're doing well, too