TastyHint1.md
· 928 B · Markdown
Brut
Remember start _very small_ and build outward.
## Hint 1
If you haven't already decided how to start...
This is the `tasks` variable.
```
Tasty class.
:param tasks: the user tasks
```
The most important thing is the tasks you're tracking.
It tracks all the tasks, things that get added and removed.
What are the two things you want to track?
- the name/title of the Task _Buy Milk_
- status of Task _complete_ or _not yet_
so in Python, if you have a pair things that need to be tracked together, a good possibility is a Dictionary.
Imagine a dict like this one:
```python
tasks = {} # creates an empty dictionary
tasks['Buy Milk'] = 'not yet'
# to test if something is done?
task_name = 'Buy Milk'
if tasks[task_name] == 'not yet':
# task is unfinished
else:
# task is 'complete'
# to list all the tasks
for task_name, status in enumerate(tasks.items()):
print("- ", task_name, status)
```
Remember start very small and build outward.
Hint 1
If you haven't already decided how to start...
This is the tasks
variable.
Tasty class.
:param tasks: the user tasks
The most important thing is the tasks you're tracking. It tracks all the tasks, things that get added and removed.
What are the two things you want to track?
- the name/title of the Task Buy Milk
- status of Task complete or not yet
so in Python, if you have a pair things that need to be tracked together, a good possibility is a Dictionary.
Imagine a dict like this one:
tasks = {} # creates an empty dictionary
tasks['Buy Milk'] = 'not yet'
# to test if something is done?
task_name = 'Buy Milk'
if tasks[task_name] == 'not yet':
# task is unfinished
else:
# task is 'complete'
# to list all the tasks
for task_name, status in enumerate(tasks.items()):
print("- ", task_name, status)