Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Requirements Below are the requirements for this project. There is some functionality already set up in your project. Currently, if you run the program in
Requirements
Below are the requirements for this project. There is some functionality already set up in your project. Currently, if you run the program in your VSCode terminal, you will see a menu of options, as shown below:
List the tasks
Add a task
Remove a task
Mark a task complete
Quit
What would you like to do
As the user, you are able to input the number to see all tasks that currently live in the list of tasks dictionaries named tasks. The goal here is for you to write the functionality to add, remove, and mark a task complete by inputting or respectively. Instructions are listed below.
Tip!
Remember to pay attention to indenting! When defining a function, you should have a colon at the end of the line, and Python will automatically indent for you. If you're not seeing the next line indented, double check your code!
Add a Task
Within the already created addtask function, there is a variable named tasktext which is the result of the input function which prompts the user to type in something.
This input function is a new function that you haven't seen before. It is essentially the opposite of the print function. This allows the user to input text when called.
Create a dictionary that uses the tasktext variable as the name and sets completed to False.
Add the dictionary to the tasks list.
Within the while loop, add an elif statement that checks if the variable decision defined within the while loop that allows the user to input a number is call the addtask function.
Remove a task
You will need a function to handle this.
When this function is run, list out the tasks.
Hint! There is already a function that handles the listing of tasks.
Create a variable that uses input The user should be able to input the index number of the task to be removed.
Hint! You will need to wrap the input function within the int function so the user's input is read as a number.
Write the functionality to be able to delete the task in the list tasks based on the variable you created above.
Within the while loop, add an elif statement that allows your new function to be run when the correct menu option is chosen.
Mark a task complete
You will need a function to handle this.
When this function is run, list out the tasks.
Hint! There is already a function that handles the listing of tasks.
Create a variable that uses input. The user should be able to input the index number of the task to be marked complete.
Hint! You will need to wrap the input function within the int function so the user's input is read as a number.
Mark the task as complete in the list tasks based on the variable you created above.
Hint! you will need to use two sets of square brackets to find the index and set the appropriate key to True.
Within the while loop, add an elif statement that allows your new function to be run when the correct menu option is chosen.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started