{"id":133,"date":"2026-03-20T07:30:03","date_gmt":"2026-03-20T07:30:03","guid":{"rendered":"https:\/\/alpeshconnect.in\/blog\/?p=133"},"modified":"2026-03-20T07:30:03","modified_gmt":"2026-03-20T07:30:03","slug":"text-conversion-in-python","status":"publish","type":"post","link":"https:\/\/alpeshconnect.in\/blog\/2026\/03\/20\/text-conversion-in-python\/","title":{"rendered":"Text Conversion in Python"},"content":{"rendered":"\n<p>Python Program that accept a line of Text from user and perform Togglecase, Title case, Sentence Case, Exit. Also menu will be repeated until select Exit.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Text Case Conversion<\/h1>\n\n\n\n<p>text = input(&#8220;\\nEnter a line of text: &#8220;)<\/p>\n\n\n\n<p>while True:<br>print(&#8220;\\n1. Toggle Case&#8221;)<br>print(&#8220;2. Title Case&#8221;)<br>print(&#8220;3. Sentence Case&#8221;)<br>print(&#8220;4. Exit&#8221;)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>choice = input(\"Enter choice: \")\n\n# Toggle Case\nif choice == '1':\n    print(\"Result:\", text.swapcase())\n\n# Title Case\nelif choice == '2':\n    print(\"Result:\", text.title())\n\n# Sentence Case\nelif choice == '3':\n    print(\"Result:\", text.capitalize())\n\n# Exit\nelif choice == '4':\n    print(\"Program exited.\")\n    break\n\nelse:\n    print(\"Invalid choice!\")<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Python Program that accept a line of Text from user and perform Togglecase, Title case, Sentence Case, Exit. Also menu will be repeated until select Exit. Text Case Conversion text = input(&#8220;\\nEnter a line of text: &#8220;) while True:print(&#8220;\\n1. Toggle Case&#8221;)print(&#8220;2. Title Case&#8221;)print(&#8220;3. Sentence Case&#8221;)print(&#8220;4. 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,45],"class_list":["post-133","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-python"],"_links":{"self":[{"href":"https:\/\/alpeshconnect.in\/blog\/wp-json\/wp\/v2\/posts\/133","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=133"}],"version-history":[{"count":1,"href":"https:\/\/alpeshconnect.in\/blog\/wp-json\/wp\/v2\/posts\/133\/revisions"}],"predecessor-version":[{"id":134,"href":"https:\/\/alpeshconnect.in\/blog\/wp-json\/wp\/v2\/posts\/133\/revisions\/134"}],"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=133"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alpeshconnect.in\/blog\/wp-json\/wp\/v2\/categories?post=133"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alpeshconnect.in\/blog\/wp-json\/wp\/v2\/tags?post=133"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}