Assignment Three
Due: Friday, March 1 at 11:59.999999 pm
100 Points
Work with Python classes and common functions to build a simple script.
Use the built-in features of Python to keep track of list of your favorite movies. Define functions to output data in specific formats, and filter the data to return specific items that match the criteria. You are expected to use classes, inheritance, decorators, list comprehensions, string manipulation functions, etc.
Your script will run non-interactively.
These are the base requirements for making the page work. You can enhance. You cannot use any Python imports for this project.
Media
Class
title
as a parameterslug
method that returns the title in lower case title
!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
for ... in ...:
)-
Don't Tell Mom the Babysitter's Dead
would be dont-tell-mom-the-babysitters-dead
G.I. Joe
would be gi-joe
Movie
Class
Media
classsuper
method to set title
in constructor.__repr__
method to return <Movie: Title>
__str__
method to return (Year) Title
abbreviation
method that returns first three characters of title in lower case with no spaces or special characters.slugs()
function that uses a list comprehension to print()
each Movie
slug.abbr()
function that uses a list comprehension to print()
each Movie
abbreviation.before_year()
function that takes an int
parameter as a year and uses a list comprehension to print()
each Movie
object if the movie was released before a specified year.main()
function and
Thanks for checking the Local Movie Database!
slugs()
abbr()
before_year()
Thank you
at the endslugs()
, abbr()
, and before_year()
:
msg
"=====\n%s\n=====" % msg
if __name__ == '__main__':
block at end of file
Movie
objects to movies
list.main()
function.movies.py
, and place it in the root directory of your repository.README.md
movies.py
We will download a zip archive of the repo and run the movies.py
file in a terminal/console using Python version 3.7 (python movies.py
).
super
: 10%slug
method works appropriately: 15%abbreviation
method works appropriately: 10%str
and repr
functions defined and return correctly: 10%Late assignments will receive zero credit.