Python programming and problem solving based on the requirement

Words: 312
Pages: 2
Subject: Premium Writing

The following guidelines should be followed and will be used to grade your homework:
• All code to be implemented and submitted as a jupyter notebook (.ipynb) file.
• This is an individual homework assignment; no group submissions will be accepted. If you discuss in groups, please write your code individually and submit.
• Sample runs shown in the question should be used as a guide for implementation. However extensive testing needs to be done on your code to deal with all test cases that might possibly be executed.
• The high-level algorithm of how you are solving the problem should be documented in the cell preceding the code in markdown language.
• The instructions for running of each cell and the expected results should be documented in the cell preceding the code using markdown language.
• Every code segment in the jupyter notebook cells should be well documented with comments. Use # in the code to provide comments and they should explain the algorithm step and what the code segment is doing.
• Error checking in your code is very important and differentiates a high-quality programmer from a low quality one. Hence you should account for invalid user inputs, infinite loops, out of range results, etc. and resolve them by appropriate error messages. The homework will be graded for robustness of your code.