Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PYTHON . Develop a program to maintain a list of homework assignments. When an assignment is assigned, add it to the list with a due

  1. PYTHON. Develop a program to maintain a list of homework assignments. When an assignment is assigned, add it to the list with a due date, and when it is completed, remove it. No global variables are used in the function. Function parameters must be used.

Your program should provide the following functions:

  1. Add a new assignment.
  2. Remove an assignment.
  3. Provide a list of the assignments in the order they were assigned. The output should display each assignment line by line.
  4. Provide a list of the assignments in the order they are due. The output should display each assignment line by line.

Use the following starter code to help. Read the comments carefully.

def add_assignment(assignment_list, assignment): # add assignment to assignment_list

def remove_assignment(assignment_list, assignment): # remove an assignment from the assignment_list # if the assignment exists in the assignment_list

def display_assignments(assignment_list): print("Assignments in the order they were assigned") # print each assignment line by line def display_assignments_by_due_date(assignment_list): print("Assignments in the order they are due")

# print each assignment line by line

# create an empty list to hold the assignments

my_assignments = [ ] # create an assignment.

# Put date in first field with YYYY/MM/DD format assignment1 = ["2018/10/07", "MATH101"] # create more assignments # call add_assignment function to add assignment add_assignment(my_assignments, assignment1) # call add_assignment to add more assignments to the assignment_list # display the assignments by order they are entered # and by the order they are due. # call remove_assignment to remove one assignment # display the assignments by order they are entered and # by order they are due.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Management An Organizational Perspective

Authors: Richard T. Watson

1st Edition

0471305340, 978-0471305347

More Books

Students also viewed these Databases questions

Question

6. How do histories influence the process of identity formation?

Answered: 1 week ago