Naposledy aktivní 1731350546

Revize de4ab0973e32d44c5717ec172b4b39d343947830

TastyHint1.md Raw

Remember start very small and build outward.

Hint 1

If you haven't already decided what

    Tasty class.
    :param tasks: the user tasks

this is the tasks variable. It tracks all the tasks 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)