|
|
|
|
|
by ouija
1433 days ago
|
|
I prefer the Python code here. The import is explicit, so if you want to know where "date" comes from, that's easy. In a modern IDE I don't write imports manually anyway. You could write it as a one-liner in Python as well, but I would prefer not to. print("It's Saturday") if date.today().weekday() == 5 else None
That the Python library doesn't define constants for days is unfortunate, but not a limitation of the language. |
|