Open main menu

CDOT Wiki β

Changes

OPS435 Python Assignment 2 A

432 bytes added, 01:36, 29 March 2018
Program structure
* The tomorrow() function will take a date in "YYYYMMDD" format and return the date of the next day in the same format. Next paragraph is a sample python code for the tomorrow() function.
 
<pre>
#!/usr/sbin/env python3
import ...
 
def tomorrow(today):
....
return next_day
 
def yesterday(today):
....
return previous_day
 
....
 
if __name__ == __main__:
 
.. processing command line arguments ..
.. set loop based on the number of days given
.. call tomorrow() or yesterday() as appropriate
...
output the expected date
 
</pre>
=== Sample code for the tomorrow() function ===
1,760
edits