Open main menu

CDOT Wiki β

Changes

OPS435 Assignment 1 for Section B

322 bytes added, 22:59, 8 October 2020
Script structure and sample template
The following is a brief description of each function:
* The leap_year() function will take a year in "YYYY" format, and return True if the given year is a leap year, otherwise return False.
* The size_check() function * The valid_date() function will take a date in "DD-MM-YYYY" format, an collection data type object and expected number of items as an integer and will return either 'True if ' or 'False'. If the number of items in the data object match the integer value given date is a valid date, return 'True', otherwise return 'False plus an appropriate status message. The valid_date() function should make use of the days_in_mon() function.'* The days_in_monrange_check() function will take an integer object and a year in "YYYY" formattuple with two integer values, the first value indicates the lower bound and return the second one indicates the upper bound of a dictionary integer range. If the integer object which contains falls in between the total number of days range given in each month for the given yeartuple, return 'True', otherwise return 'False'. * The days_in_monsanitize() function should make use of will take two string objects, the first string object is the object to be sanitized, and the leap_year() 2nd string object contains letters that are allowed. This functionwill return the first object with letters not in the 2nd string object removed.
* The usage() function will take no argument and return a string describing the usage of the script.
1,760
edits