{"id":3098,"date":"2021-04-20T12:35:30","date_gmt":"2021-04-20T07:05:30","guid":{"rendered":"https:\/\/python-programs.com\/?p=3098"},"modified":"2021-11-22T18:45:04","modified_gmt":"2021-11-22T13:15:04","slug":"basics-of-python-error","status":"publish","type":"post","link":"https:\/\/python-programs.com\/basics-of-python-error\/","title":{"rendered":"Basics of Python \u2013 Error"},"content":{"rendered":"

In this Page, We are Providing Basics of Python \u2013 Error. Students can visit for more Detail and Explanation of Python Handwritten Notes<\/a>\u00a0Pdf.<\/p>\n

Basics of Python \u2013 Error<\/h2>\n

Error<\/strong><\/p>\n

An error (or software bug) is a fault in a computer program that produces an incorrect or unexpected result or causes it to behave in unintended ways. Most bugs arise from mistakes and errors made by people in either a program’s source code or its design. Usually, errors are classified as: syntax error, run-time error, and logical error.<\/p>\n

Syntax error<\/strong><\/p>\n

Syntax error refers to an error in the syntax of tokens and\/or sequence of tokens that are intended to be written in a particular programming language. For compiled languages, syntax errors occur strictly at compile-time. A program will not compile until all syntax errors are corrected. For interpreted languages, however, not all syntax errors can be reliably detected until run-time.<\/p>\n

>>> prin ' Hi '\r\nSyntaxError: invalid syntax \r\n>>> print \" Hi '\r\nSyntaxError: EOL while scanning string literal<\/pre>\n

Run-time error<\/strong><\/p>\n

A run-time error is an error that can be detected during the execution of a program. The code appears to be correct (it has no syntax errors), but it will not execute. For example, if a programmer has written a correct code to open a file using the open ( ) function, and if the file is corrupted, the application cannot carry out the execution of the open ( ) function, and it stops running.<\/p>\n

Logical error<\/strong><\/p>\n

A logical error (or semantic error) is a bug in a program that causes it to operate incorrectly, but not terminate abnormally. A logical error produces an unintended or undesired output or other behavior, although it may not immediately be recognized. The logic error occurs both in compiled and interpreted languages.<\/p>\n

Unlike a program with a syntax error, a program with a logical error is a valid program in the language, though it does not behave as intended. The only clue to the existence of logic errors in the production of wrong solutions. For example, if a program calculates the average of variables a and b, instead of writing the expression c= (a+b) \/ 2, one can write c=a+b \/ 2, which is a logical error.<\/p>\n

>>> print a+b \/ 2 \r\n6 . 5\r\n>>> print ( a+b ) \/ 2\r\n5 . 0<\/pre>\n","protected":false},"excerpt":{"rendered":"

In this Page, We are Providing Basics of Python \u2013 Error. Students can visit for more Detail and Explanation of Python Handwritten Notes\u00a0Pdf. Basics of Python \u2013 Error Error An error (or software bug) is a fault in a computer program that produces an incorrect or unexpected result or causes it to behave in unintended …<\/p>\n

Basics of Python \u2013 Error<\/span> Read More »<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[5],"tags":[],"yoast_head":"\nBasics of Python \u2013 Error - Python Programs<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/python-programs.com\/basics-of-python-error\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Basics of Python \u2013 Error - Python Programs\" \/>\n<meta property=\"og:description\" content=\"In this Page, We are Providing Basics of Python \u2013 Error. Students can visit for more Detail and Explanation of Python Handwritten Notes\u00a0Pdf. Basics of Python \u2013 Error Error An error (or software bug) is a fault in a computer program that produces an incorrect or unexpected result or causes it to behave in unintended … Basics of Python \u2013 Error Read More »\" \/>\n<meta property=\"og:url\" content=\"https:\/\/python-programs.com\/basics-of-python-error\/\" \/>\n<meta property=\"og:site_name\" content=\"Python Programs\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/btechgeeks\" \/>\n<meta property=\"article:published_time\" content=\"2021-04-20T07:05:30+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-11-22T13:15:04+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@btech_geeks\" \/>\n<meta name=\"twitter:site\" content=\"@btech_geeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Prasanna\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https:\/\/python-programs.com\/#organization\",\"name\":\"BTech Geeks\",\"url\":\"https:\/\/python-programs.com\/\",\"sameAs\":[\"https:\/\/www.instagram.com\/btechgeeks\/\",\"https:\/\/www.linkedin.com\/in\/btechgeeks\",\"https:\/\/in.pinterest.com\/btechgeek\/\",\"https:\/\/www.youtube.com\/channel\/UC9MlCqdJ3lKqz2p5114SDIg\",\"https:\/\/www.facebook.com\/btechgeeks\",\"https:\/\/twitter.com\/btech_geeks\"],\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/python-programs.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/python-programs.com\/wp-content\/uploads\/2020\/11\/BTechGeeks.png\",\"contentUrl\":\"https:\/\/python-programs.com\/wp-content\/uploads\/2020\/11\/BTechGeeks.png\",\"width\":350,\"height\":70,\"caption\":\"BTech Geeks\"},\"image\":{\"@id\":\"https:\/\/python-programs.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/python-programs.com\/#website\",\"url\":\"https:\/\/python-programs.com\/\",\"name\":\"Python Programs\",\"description\":\"Python Programs with Examples, How To Guides on Python\",\"publisher\":{\"@id\":\"https:\/\/python-programs.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/python-programs.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/python-programs.com\/basics-of-python-error\/#webpage\",\"url\":\"https:\/\/python-programs.com\/basics-of-python-error\/\",\"name\":\"Basics of Python \u2013 Error - Python Programs\",\"isPartOf\":{\"@id\":\"https:\/\/python-programs.com\/#website\"},\"datePublished\":\"2021-04-20T07:05:30+00:00\",\"dateModified\":\"2021-11-22T13:15:04+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/python-programs.com\/basics-of-python-error\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/python-programs.com\/basics-of-python-error\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/python-programs.com\/basics-of-python-error\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/python-programs.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Basics of Python \u2013 Error\"}]},{\"@type\":\"Article\",\"@id\":\"https:\/\/python-programs.com\/basics-of-python-error\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/python-programs.com\/basics-of-python-error\/#webpage\"},\"author\":{\"@id\":\"https:\/\/python-programs.com\/#\/schema\/person\/ea8ce699662f0d7e248e52fe080b85bb\"},\"headline\":\"Basics of Python \u2013 Error\",\"datePublished\":\"2021-04-20T07:05:30+00:00\",\"dateModified\":\"2021-11-22T13:15:04+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/python-programs.com\/basics-of-python-error\/#webpage\"},\"wordCount\":353,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/python-programs.com\/#organization\"},\"articleSection\":[\"Python\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/python-programs.com\/basics-of-python-error\/#respond\"]}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/python-programs.com\/#\/schema\/person\/ea8ce699662f0d7e248e52fe080b85bb\",\"name\":\"Prasanna\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/python-programs.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/174540ad43736c7d1a4c4f83c775e74d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/174540ad43736c7d1a4c4f83c775e74d?s=96&d=mm&r=g\",\"caption\":\"Prasanna\"},\"url\":\"https:\/\/python-programs.com\/author\/prasanna\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Basics of Python \u2013 Error - Python Programs","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/python-programs.com\/basics-of-python-error\/","og_locale":"en_US","og_type":"article","og_title":"Basics of Python \u2013 Error - Python Programs","og_description":"In this Page, We are Providing Basics of Python \u2013 Error. Students can visit for more Detail and Explanation of Python Handwritten Notes\u00a0Pdf. Basics of Python \u2013 Error Error An error (or software bug) is a fault in a computer program that produces an incorrect or unexpected result or causes it to behave in unintended … Basics of Python \u2013 Error Read More »","og_url":"https:\/\/python-programs.com\/basics-of-python-error\/","og_site_name":"Python Programs","article_publisher":"https:\/\/www.facebook.com\/btechgeeks","article_published_time":"2021-04-20T07:05:30+00:00","article_modified_time":"2021-11-22T13:15:04+00:00","twitter_card":"summary_large_image","twitter_creator":"@btech_geeks","twitter_site":"@btech_geeks","twitter_misc":{"Written by":"Prasanna","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Organization","@id":"https:\/\/python-programs.com\/#organization","name":"BTech Geeks","url":"https:\/\/python-programs.com\/","sameAs":["https:\/\/www.instagram.com\/btechgeeks\/","https:\/\/www.linkedin.com\/in\/btechgeeks","https:\/\/in.pinterest.com\/btechgeek\/","https:\/\/www.youtube.com\/channel\/UC9MlCqdJ3lKqz2p5114SDIg","https:\/\/www.facebook.com\/btechgeeks","https:\/\/twitter.com\/btech_geeks"],"logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/python-programs.com\/#\/schema\/logo\/image\/","url":"https:\/\/python-programs.com\/wp-content\/uploads\/2020\/11\/BTechGeeks.png","contentUrl":"https:\/\/python-programs.com\/wp-content\/uploads\/2020\/11\/BTechGeeks.png","width":350,"height":70,"caption":"BTech Geeks"},"image":{"@id":"https:\/\/python-programs.com\/#\/schema\/logo\/image\/"}},{"@type":"WebSite","@id":"https:\/\/python-programs.com\/#website","url":"https:\/\/python-programs.com\/","name":"Python Programs","description":"Python Programs with Examples, How To Guides on Python","publisher":{"@id":"https:\/\/python-programs.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/python-programs.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/python-programs.com\/basics-of-python-error\/#webpage","url":"https:\/\/python-programs.com\/basics-of-python-error\/","name":"Basics of Python \u2013 Error - Python Programs","isPartOf":{"@id":"https:\/\/python-programs.com\/#website"},"datePublished":"2021-04-20T07:05:30+00:00","dateModified":"2021-11-22T13:15:04+00:00","breadcrumb":{"@id":"https:\/\/python-programs.com\/basics-of-python-error\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/python-programs.com\/basics-of-python-error\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/python-programs.com\/basics-of-python-error\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/python-programs.com\/"},{"@type":"ListItem","position":2,"name":"Basics of Python \u2013 Error"}]},{"@type":"Article","@id":"https:\/\/python-programs.com\/basics-of-python-error\/#article","isPartOf":{"@id":"https:\/\/python-programs.com\/basics-of-python-error\/#webpage"},"author":{"@id":"https:\/\/python-programs.com\/#\/schema\/person\/ea8ce699662f0d7e248e52fe080b85bb"},"headline":"Basics of Python \u2013 Error","datePublished":"2021-04-20T07:05:30+00:00","dateModified":"2021-11-22T13:15:04+00:00","mainEntityOfPage":{"@id":"https:\/\/python-programs.com\/basics-of-python-error\/#webpage"},"wordCount":353,"commentCount":0,"publisher":{"@id":"https:\/\/python-programs.com\/#organization"},"articleSection":["Python"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/python-programs.com\/basics-of-python-error\/#respond"]}]},{"@type":"Person","@id":"https:\/\/python-programs.com\/#\/schema\/person\/ea8ce699662f0d7e248e52fe080b85bb","name":"Prasanna","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/python-programs.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/174540ad43736c7d1a4c4f83c775e74d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/174540ad43736c7d1a4c4f83c775e74d?s=96&d=mm&r=g","caption":"Prasanna"},"url":"https:\/\/python-programs.com\/author\/prasanna\/"}]}},"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/posts\/3098"}],"collection":[{"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/comments?post=3098"}],"version-history":[{"count":1,"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/posts\/3098\/revisions"}],"predecessor-version":[{"id":3122,"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/posts\/3098\/revisions\/3122"}],"wp:attachment":[{"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/media?parent=3098"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/categories?post=3098"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/python-programs.com\/wp-json\/wp\/v2\/tags?post=3098"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}