Ask coding questions

← Back to all posts
Would you mind checking this for me?
Dominicl645 (428)

if you don't mind, could you check this for me and see if i did it correctly? I'm not asking you to give me answers or anything like that, I just want to make sure i did this correctly. Here where the instructions:
Write a program to find out if 4th of July of this year has passed or not
Import DateTime from datetime
Get today’s date
Create variable named todays_date and use the .today() function on datettime
4th of July of the current year
Create variable july_4th and assign date time with attributes for the month, day and year of this years july 4th
Use if statement to determine if 4th july is less than todays date
Print july 4th has passed
If not print july 4th has not passed yet

this is all i need checked. thanks you.

Answered by RYANTADIPARTHI (3231) [earned 5 cycles]
View Answer

Looks pretty good, except for one thing. July fourth has passed. Might want to fix that.

Coder100 (12434)

Hmm, here's what I get:

July 4th has passed this year.

Dominicl645 (428)

i changed the if statement, is it better now? @Coder100

Coder100 (12434)

np! Mark as correct answer? @dominicl645

Coder100 (12434)


oh and btw just one more thing, your current july 4th doesn't seem very accurate (july is not october silly!)

Dominicl645 (428)

no that is 3 weeks before my bday. the last part is the assignment i needed checked. @Coder100

Dominicl645 (428)

ugh now im starting to work with the "os" module. any hints or tips?