{"id":956,"date":"2021-06-10T10:15:20","date_gmt":"2021-06-10T04:45:20","guid":{"rendered":"https:\/\/cbsepython.in\/?p=956"},"modified":"2021-09-29T22:12:53","modified_gmt":"2021-09-29T16:42:53","slug":"number-system-converter-python-project","status":"publish","type":"post","link":"https:\/\/cbsepython.in\/number-system-converter-python-project\/","title":{"rendered":"Number System Converter- Python Project for CBSE Class 11"},"content":{"rendered":"<p>Number System Converter- Python Project<\/p>\n<p>Source Code:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\"># -*- coding: utf-8 -*-\r\n\"\"\"\r\n\r\n@author: cbsepython\r\n\"\"\"\r\n\r\nwhile 1&gt;0:\r\n    inp=int(input(\"enter the number:\"))\r\n    org=int(input(\"enter it base:\"))\r\n    to=int(input(\"enter the base in which it is to be converted:\"))\r\n    print(\"\\n\")\r\n######################################################################@\r\n    if to==2 or to==8 or to==16 or to==10:\r\n        out1=0\r\n        power=0\r\n        while inp&gt;0:\r\n            out1+=org**power*(inp%10)\r\n            inp\/\/=10\r\n            power+=1\r\n        print(\"after conversion the result in decimal is:\",out1)\r\n#######################################################################\r\n    if to==8:\r\n        out2=0\r\n        power=0\r\n        while out1&gt;0:\r\n            out2+=10**power*(out1%8)\r\n            out1\/\/=8\r\n            power+=1\r\n        print(\"after conversion into octal the result is:\",out2)\r\n#######################################################################\r\n    \r\n#######################################################################\r\n    elif to==2:\r\n        out4=0\r\n        power=0\r\n        while out1&gt;0:\r\n            out4+=10**power*(out1%2)\r\n            out1\/\/=2\r\n            power+=1\r\n        print(\"after conversion into binary the result is:\",out4)\r\n########################################################################\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>Output:<\/p>\n<pre>enter the number:10\r\nenter it base:5\r\nenter the base in which it is to be converted:2\r\n\r\n\r\n('after conversion the result in decimal is:', 5)\r\n('after conversion into binary the result is:', 101)\r\nenter the number:\r\n\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Number System Converter- Python Project Source Code: # -*- coding: utf-8 -*- &#8220;&#8221;&#8221; @author: cbsepython &#8220;&#8221;&#8221; while 1&gt;0: inp=int(input(&#8220;enter the number:&#8221;)) org=int(input(&#8220;enter it base:&#8221;)) to=int(input(&#8220;enter the base in which it is to be converted:&#8221;)) print(&#8220;\\n&#8221;) ######################################################################@ if to==2 or to==8 or to==16 or to==10: out1=0 power=0 while inp&gt;0: out1+=org**power*(inp%10) inp\/\/=10 power+=1 print(&#8220;after conversion the result [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[43],"tags":[],"class_list":["post-956","post","type-post","status-publish","format-standard","hentry","category-python-projects"],"_links":{"self":[{"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/posts\/956","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/comments?post=956"}],"version-history":[{"count":0,"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/posts\/956\/revisions"}],"wp:attachment":[{"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/media?parent=956"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/categories?post=956"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/tags?post=956"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}