{"id":131,"date":"2026-03-20T07:22:36","date_gmt":"2026-03-20T07:22:36","guid":{"rendered":"https:\/\/alpeshconnect.in\/blog\/?p=131"},"modified":"2026-03-20T07:22:36","modified_gmt":"2026-03-20T07:22:36","slug":"student-list-operations-in-python","status":"publish","type":"post","link":"https:\/\/alpeshconnect.in\/blog\/2026\/03\/20\/student-list-operations-in-python\/","title":{"rendered":"Student List operations in Python"},"content":{"rendered":"\n<p>Python Program to create a list for student name and perform Append Name in list, Display list, Count Total number of students in list, Display last 3 names of a list.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Student Name List<\/h1>\n\n\n\n<p>students = []<\/p>\n\n\n\n<p>while True:<br>print(&#8220;\\n1. Append Name&#8221;)<br>print(&#8220;2. Display List&#8221;)<br>print(&#8220;3. Count Students&#8221;)<br>print(&#8220;4. Display Last 3 Names&#8221;)<br>print(&#8220;5. Exit&#8221;)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>choice = input(\"Enter choice: \")\n\n# Append Name\nif choice == '1':\n    name = input(\"Enter student name: \")\n    students.append(name)\n    print(\"Name added.\")\n\n# Display List\nelif choice == '2':\n    if students:\n        print(\"Student List:\", students)\n    else:\n        print(\"List is empty.\")\n\n# Count Students\nelif choice == '3':\n    print(\"Total students:\", len(students))\n\n# Display Last 3 Names\nelif choice == '4':\n    if len(students) &gt;= 3:\n        print(\"Last 3 names:\", students&#91;-3:])\n    else:\n        print(\"Less than 3 students:\", students)\n\n# Exit\nelif choice == '5':\n    break\n\nelse:\n    print(\"Invalid choice!\")<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Python Program to create a list for student name and perform Append Name in list, Display list, Count Total number of students in list, Display last 3 names of a list. Student Name List students = [] while True:print(&#8220;\\n1. Append Name&#8221;)print(&#8220;2. Display List&#8221;)print(&#8220;3. Count Students&#8221;)print(&#8220;4. Display Last 3 Names&#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":[25,26,46,47,45],"class_list":["post-131","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-bca","category-programming-skills","tag-bca","tag-bca-paper-solution","tag-programming-skills","tag-pyth","tag-python"],"_links":{"self":[{"href":"https:\/\/alpeshconnect.in\/blog\/wp-json\/wp\/v2\/posts\/131","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=131"}],"version-history":[{"count":1,"href":"https:\/\/alpeshconnect.in\/blog\/wp-json\/wp\/v2\/posts\/131\/revisions"}],"predecessor-version":[{"id":132,"href":"https:\/\/alpeshconnect.in\/blog\/wp-json\/wp\/v2\/posts\/131\/revisions\/132"}],"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=131"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alpeshconnect.in\/blog\/wp-json\/wp\/v2\/categories?post=131"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alpeshconnect.in\/blog\/wp-json\/wp\/v2\/tags?post=131"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}