Open main menu

CDOT Wiki β

Changes

OPS435 Assignment 1 for Section B

No change in size, 23:01, 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 will take an collection data type object and expected number of items as an integer and will return either 'True' or 'False'. If the number of items in the data object match the integer value given, return 'True', otherwise return 'False'
* The range_check() function will take an integer object and a tuple with two integer values, the first value indicates the lower bound and the second one indicates the upper bound of a integer range. If the integer object falls in between the range given in the tuple, return 'True', otherwise return 'False'.
* The sanitize() function will take two string objects, the first string object is the object to be sanitized, and the 2nd string object contains letters that are allowed. This function will return the first object with letters not in the 2nd string object removed.
* The size_check() function will take an collection data type object and expected number of items as an integer and will return either 'True' or 'False'. If the number of items in the data object match the integer value given, return 'True', otherwise return 'False'
* The usage() function will take no argument and return a string describing the usage of the script.
1,760
edits