Open main menu

CDOT Wiki β

Changes

OPS435 Python3 Assignment 2P

401 bytes added, 22:21, 7 November 2019
Test for day of the week method
=== Test for day of the week method ===
: The day of week on Jan 1, 1970 is Thursday. The date.day_of_week() method should return the day of week for the give date in numeric form.
:: 0 - Sun,
:: 1 - Mon,
:: 2 - Tue,
:: 3 - Wed,
:: 4 - Thu,
:: 5 - Friday, and
:: 6 - Saturday <source lang="python">
>>> d1 = Date(2019,11,7)
>>> d1
2019-11-07
>>> d1.day_of_week()
4
>>> d2 = d1 + 7
>>> d2
2019-11-14
>>> d2.day_of_week()
4
>>>
</source>
== Script structure and sample template ==
1,760
edits