Python Programming Code
Description
- The class President is defined with the appropriate six methods correctly defined (5 points each)
- __init__ (Hint: you need to initialize the attributes. Ex: self.name = first + ” ” + last)
- get_name
- get_number
- get_occupation
- get_time_in_office
- __str__ (Hint: when this is defined correctly, the function print_all_presidents will work correctly)
- The function print_by_name is correct when the substring argument is present in a president’s name and absent
- The function print_by_name prompts the user for a longer substring when the substring contains fewer than 3 characters.
- . The function print_by_number is correct when the number is valid (7 points) and invalid (3 points).
- The function count_by_occupation correctly prints the number of presidents having a given occupation (-5 if you double count Grover Cleveland)
- . The function average_term_length is correct.
- The format of the output matches the format of the output in the transcript exactly.
- The Python solution is properly commented, easy to understand and does not contain unnecessary code. (3 points for each type of improvement up to 10 points.)
Have a similar assignment? "Place an order for your assignment and have exceptional work written by our team of experts, guaranteeing you A results."