At the very beginning of each Python file you submit, you should place a docstring giving summary information about the program as a whole. This summary should include the following information:
""" File: pokemon.py Author: Charm Ander Course: CSC 120, Spring 2024 Purpose: This program processes a Pokemon file containing information about Pokemon types and their properties. It calculates the average values for each type's properties and then responds to a set of queries about the Pokemon properties. It answers the queries by printing the Pokemon type(s) that have the highest average value for that property. """
For each function or method, provide a high-level summary of what the function or method does. This information should be given in the form of a docstring and should be placed immediately after the "def function_name(...):" line. The docstring should minimally include the following information:
For your convenience, a template is available here.def sum_csv_string(csv_string): """Add the numbers in a string of comma-separated values. Parameters: csv_string is a string of comma-separated numeric values. Returns: A number that is the sum of the values in the argument string. """
If the purpose or behavior of a piece of code is not obvious, comment it, with a hashtag character. However, don't just state the obvious—this only adds visual clutter. For example, the following comment is clutter:
x = x + 1 # increment x
For each class, give a docstring right after the "class MyClass:" line giving a high-level summary of the class, namely:
This docstring is supposed to be a summary of the class, so it should not generally mention any of the attributes or methods, nor go into too much detail about how it's implemented. Make sure to write function headers for your methods as well, which will give more detail on those separately.
For example:
class Temp: """This class represents temperatures in either Celsius or Fahrenheit. The class defines the methods for the comparison operations <, ≤, >, ≥, ==, and != using the special methods for each of those operations. Note that temperatures in different units can be compared since the underlying comparison operator will apply conversion formulas in order to compare them correctly. """An example of a method docstring is here:
def __eq__(self, other): """Returns True if the Temp object self is equal to the Temp object other and False otherwise. If the temperatures are in different units, the method computes a common unit for the comparison. Parameters: other is another Temp object that this method needs to compare with the self object. Returns: True or False """Note: You must provide a docstring for the __init__() method, but you do not need to provide docstrings for simple getters and setters or for __str__().
PI = 3.1416
DEFAULT_SIZE = 64