diff --git a/Seth_A99501/day17.ipynb b/Seth_A99501/day17.ipynb new file mode 100644 index 00000000..fdc1d21a --- /dev/null +++ b/Seth_A99501/day17.ipynb @@ -0,0 +1,48 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "TaskManager=[{\"Task1\":{\"Month\":\"September\",\"Activities\":\"gyming\",\"location\":\"Parking\", \"status\":\"complete\"}},\n", + " {\"Task2\":{\"Month\":\"October\",\"Activities\":\"swimming\", \"location\":\"Hotel\",\"status\":\"pending\"}}]\n", + "print(TaskManager)\n", + "#adding a task \n", + "New_Task={\"Task3\":{\"Month\":\"January\",\"Activities\":\"dacing\",\"location\":\"Nkoyoyo\", \"status\":\"pending\"}}\n", + "TaskManager.append(New_Task)\n", + "\n", + "\n", + "\n", + "#modifying the state\n", + "for task in TaskManager:\n", + " if \"Task2\" in task:\n", + " task[\"Task2\"][\"status\"]=\"complete\"\n", + "\n", + "#accessing the data\n", + "for status in TaskManager:\n", + " if \"Task2\" in status:\n", + " print('Status')\n", + " print(status[\"Task2\"][\"status\"])\n", + "\n", + "\n", + "\n", + "print(TaskManager)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "name": "python", + "version": "3.11.6" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +}