Код: Выделить всё
def mark_task():
global freetime
print("You selected Option 5.")
#Counting the tasks
count2 = 0
for i, row in enumerate(mytask):
count2 += 1
print(count2,".",row['task_name'],".status: ",row['status'])
task_nam = input("Select the task you want to update: ")
status = input("Enter status(Pending/Completed): ")
#marking tasks
for i, row in enumerate(mytask):
if row['task_name'] == task_nam:
row['status'] = status
print(f'Status {status} updated for the task {row['task_name']}')
freetime += 1
break
elif row['task_name'] != task_nam:
print(f"Record Not found in the dictionary {task_nam}")
break
Подробнее здесь: https://stackoverflow.com/questions/798 ... g-csv-file
Мобильная версия