{"id":128,"date":"2026-03-20T07:13:29","date_gmt":"2026-03-20T07:13:29","guid":{"rendered":"https:\/\/alpeshconnect.in\/blog\/?p=128"},"modified":"2026-03-20T07:22:57","modified_gmt":"2026-03-20T07:22:57","slug":"student-dictionary-with-insert-update-and-delete-operations-in-python","status":"publish","type":"post","link":"https:\/\/alpeshconnect.in\/blog\/2026\/03\/20\/student-dictionary-with-insert-update-and-delete-operations-in-python\/","title":{"rendered":"Student dictionary with Insert, Update, and Delete operations in Python"},"content":{"rendered":"\n<p>Python Program to create a dictionary for student data which contain Roll No, Name, Div., Marks and City. Perform Insert, Update, Delete operation on it.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Student Dictionary<\/h1>\n\n\n\n<p>students = {}<\/p>\n\n\n\n<p>while True:<br>print(&#8220;\\n1. Insert&#8221;)<br>print(&#8220;2. Update&#8221;)<br>print(&#8220;3. Delete&#8221;)<br>print(&#8220;4. Display&#8221;)<br>print(&#8220;5. Exit&#8221;)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>choice = input(\"Enter choice: \")\n\n# Insert\nif choice == '1':\n    roll = input(\"Enter Roll No: \")\n    name = input(\"Enter Name: \")\n    div = input(\"Enter Division: \")\n    marks = input(\"Enter Marks: \")\n    city = input(\"Enter City: \")\n\n    students&#91;roll] = {\n        \"Name\": name,\n        \"Div\": div,\n        \"Marks\": marks,\n        \"City\": city\n    }\n    print(\"Student inserted.\")\n\n# Update\nelif choice == '2':\n    roll = input(\"Enter Roll No to update: \")\n    if roll in students:\n        students&#91;roll]&#91;\"Name\"] = input(\"Enter new Name: \")\n        students&#91;roll]&#91;\"Div\"] = input(\"Enter new Division: \")\n        students&#91;roll]&#91;\"Marks\"] = input(\"Enter new Marks: \")\n        students&#91;roll]&#91;\"City\"] = input(\"Enter new City: \")\n        print(\"Student updated.\")\n    else:\n        print(\"Student not found.\")\n\n# Delete\nelif choice == '3':\n    roll = input(\"Enter Roll No to delete: \")\n    if roll in students:\n        del students&#91;roll]\n        print(\"Student deleted.\")\n    else:\n        print(\"Student not found.\")\n\n# Display\nelif choice == '4':\n    if students:\n        for roll in students:\n            print(\"\\nRoll No:\", roll)\n            print(\"Name:\", students&#91;roll]&#91;\"Name\"])\n            print(\"Div:\", students&#91;roll]&#91;\"Div\"])\n            print(\"Marks:\", students&#91;roll]&#91;\"Marks\"])\n            print(\"City:\", students&#91;roll]&#91;\"City\"])\n    else:\n        print(\"No records found.\")\n\n# Exit\nelif choice == '5':\n    break\n\nelse:\n    print(\"Invalid choice!\")<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Python Program to create a dictionary for student data which contain Roll No, Name, Div., Marks and City. Perform Insert, Update, Delete operation on it. Student Dictionary students = {} while True:print(&#8220;\\n1. Insert&#8221;)print(&#8220;2. Update&#8221;)print(&#8220;3. Delete&#8221;)print(&#8220;4. Display&#8221;)print(&#8220;5. Exit&#8221;)<\/p>\n","protected":false},"author":1,"featured_media":96,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,44],"tags":[26,46,45],"class_list":["post-128","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-bca","category-programming-skills","tag-bca-paper-solution","tag-programming-skills","tag-python"],"_links":{"self":[{"href":"https:\/\/alpeshconnect.in\/blog\/wp-json\/wp\/v2\/posts\/128","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alpeshconnect.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/alpeshconnect.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/alpeshconnect.in\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/alpeshconnect.in\/blog\/wp-json\/wp\/v2\/comments?post=128"}],"version-history":[{"count":1,"href":"https:\/\/alpeshconnect.in\/blog\/wp-json\/wp\/v2\/posts\/128\/revisions"}],"predecessor-version":[{"id":129,"href":"https:\/\/alpeshconnect.in\/blog\/wp-json\/wp\/v2\/posts\/128\/revisions\/129"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/alpeshconnect.in\/blog\/wp-json\/wp\/v2\/media\/96"}],"wp:attachment":[{"href":"https:\/\/alpeshconnect.in\/blog\/wp-json\/wp\/v2\/media?parent=128"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alpeshconnect.in\/blog\/wp-json\/wp\/v2\/categories?post=128"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alpeshconnect.in\/blog\/wp-json\/wp\/v2\/tags?post=128"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}