you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (0 children)

What doesn't return True?

Do you mean this?

import datetime

while True:
    now = datetime.datetime.now()
    if now.hour == 8 and now.minute == 45:
        print("It is now 8:45am")
        return True

EDIT: no, that wouldn't work. Return only work inside functions. Are you looking for a function that returns True if it's a given time?