Syntax error<\/strong><\/p>\nSyntax 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>\nRun-time error<\/strong><\/p>\nA 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>\nA 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 \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\t \n\t \n\t \n