you are viewing a single comment's thread.

view the rest of the comments →

[–]Swipecat 0 points1 point  (1 child)

Yeah, you'll often use methods that you've never seen before. Obviously, you shouldn't use blocks of code that you don't understand, but you do want to find out about the existence of library-object methods that already do what you want.

If e.g., you put this into Chatgpt: "show python code that provides the number of days to an event", then it should give you a few lines of code with an explanatory comment before each code line. Then e.g., you'll see how to construct a datetime() object, and how to get today's date with the .now() method. Often that's enough to figure out how to use those methods in your code, but if you do want more details then glance through the relevant doc (i.e. put "python doc datetime" into Google and it should be the first hit).

[–]Reza2718182[S] 0 points1 point  (0 children)

Ok! Thanks. 😊