1"use strict";(self.webpackChunkdocsv_2=self.webpackChunkdocsv_2||[]).push([[3928],{4995:(n,e,t)=>{t.r(e),t.d(e,{assets:()=>l,contentTitle:()=>d,default:()=>h,frontMatter:()=>c,metadata:()=>o,toc:()=>a});const o=JSON.parse('{"id":"python/journal/6","title":"Exception handling in Python","description":"Exception handling in Python","source":"@site/docs/four/python/journal/6.mdx","sourceDirName":"python/journal","slug":"/python/journal/6","permalink":"/docs/four/python/journal/6","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":6,"frontMatter":{"title":"Exception handling in Python","sidebar_position":6,"description":"Exception handling in Python"},"sidebar":"tutorialSidebar","previous":{"title":"Inheritance in Python","permalink":"/docs/four/python/journal/5"},"next":{"title":"File handling in Python","permalink":"/docs/four/python/journal/7"}}');var i=t(4848),r=t(8453),s=t(8731);const c={title:"Exception handling in Python",sidebar_position:6,description:"Exception handling in Python"},d="Python",l={},a=[];function p(n){const e={blockquote:"blockquote",code:"code",h1:"h1",header:"header",p:"p",pre:"pre",...(0,r.R)(),...n.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(e.header,{children:(0,i.jsx)(e.h1,{id:"python",children:(0,i.jsx)(s.A,{name:"banner",description:"Exception handling in Python",children:"Python"})})}),"\n",(0,i.jsxs)(e.blockquote,{children:["\n",(0,i.jsx)(e.p,{children:"WAP to show the use of exception handling in python wit the help of try, except, else and finally block."}),"\n"]}),"\n",(0,i.jsx)(e.pre,{children:(0,i.jsx)(e.code,{className:"language-python",children:'try:\n a = 10\n b = 0\n c = a/b\n print(c)\nexcept ZeroDivisionError:\n print("Division by zero is not allowed")\nelse:\n print("Division is successful")\nfinally:\n print("End of program")\n\n# Output:\n# Division by zero is not allowed\n# End of program\n'})})]})}function h(n={}){const{wrapper:e}={...(0,r.R)(),...n.components};return e?(0,i.jsx)(e,{...n,children:(0,i.jsx)(p,{...n})}):p(n)}},8731:(n,e,t)=>{t.d(e,{A:()=>r});t(6540);var o=t(6025),i=t(4848);const r=n=>{let{name:e,description:t,children:r}=n;const s=(0,o.Ay)(`/images/${e}.jpg`);return(0,i.jsxs)("div",{style:{display:"inline-block",height:"150px",width:"100%",position:"relative",overflow:"hidden",borderRadius:"5px"},children:[(0,i.jsx)("img",{src:s,alt:s,style:{width:"100%",height:"100%",objectFit:"cover",position:"absolute",zIndex:-1}}),(0,i.jsx)("h2",{style:{color:"white",padding:"12px",boxSizing:"border-box",paddingBottom:"0px",fontWeight:"500"},children:r}),(0,i.jsx)("p",{style:{color:"white",paddingTop:"0px",paddingBottom:"12px",paddingLeft:"12px",paddingRight:"12px",boxSizing:"border-box"},children:t})]})}},8453:(n,e,t)=>{t.d(e,{R:()=>s,x:()=>c});var o=t(6540);const i={},r=o.createContext(i);function s(n){const e=o.useContext(r);return o.useMemo((function(){return"function"==typeof n?n(e):{...e,...n}}),[e,n])}function c(n){let e;return e=n.disableParentContext?"function"==typeof n.components?n.components(i):n.components||i:s(n.components),o.createElement(r.Provider,{value:e},n.children)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.