-
Notifications
You must be signed in to change notification settings - Fork 25
Formative feedback #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
merge temp branch into main
| import os | ||
|
|
||
| TASK_FILE = ".tasks.txt" | ||
| TASK_FILE = "todo_list.txt" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dont edit this...
python/todo.py
Outdated
| counter = 1 | ||
| output_string = "" | ||
|
|
||
| for i, task in enumerate(tasks): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this could be done more efficiently, but is clear, which is the main thing.
python/todo.py
Outdated
| output_string = output_string + str(counter) + ". " + task | ||
| counter = counter + 1 | ||
| return output_string | ||
| file.close() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't need file.close() with with statement.
python/todo.py
Outdated
|
|
||
|
|
||
| """Appends a task to the end of the todo list file.""" | ||
| task="Item 6" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will only ever add "Item 6"...
python/todo.py
Outdated
| """Lists tasks within the task file""" | ||
| with open(TASK_FILE, "r") as file: | ||
| tasks = file.readlines() | ||
| tasks = file.readlines() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You've also made changes to list tasks in a commit about add_task.
| @@ -1,3 +1,8 @@ | |||
| """ | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure commit only add things in the message, not extra stuff
| def remove_task(index_str): | ||
| """Removes a task by index.""" | ||
| try: | ||
| index = int(index_str) # converts the string to an integer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't need this if you'd left the int conversion in main.
|
@ZorahRajput Comments above on the formative. |
Nice work!
Things you did well:
Where you could improve: