r/learnpython • u/GingerSkwatch • Feb 23 '21
Classes. Please explain like I’m 5.
What exactly do they do? Why are they important? When do you know to use one? I’ve been learning for a few months, and it seems like, I just can’t wrap my head around this. I feel like it’s not as complicated as I’m making it, in my own mind. Thanks.
229
Upvotes
View all comments
Show parent comment
1
u/LiquidLogic Feb 24 '21
Ah, this makes sense. I just ran through your examples in Repl.it, I see the TypeErrors occuring when you don't pass an argument.
I see how adding =None would allow you to add in the date_opened later on if you didnt pass the argument and would prevent an error.
Thanks for taking the time to explain! :)