Errors in Python can be classified into
- Compile-time errors
- Runtime errors
- Logical errors
Compile-time errors:
- syntax errors can be classified as compile-time errors
- For example, let us check the output for the below Python block.
x = 0
if x = 0
print(x)
After compiling above program, output is as below:
File "F:\python-progrm\Python-Tutorial-1.py", line 10
if x = 0
^
SyntaxError: invalid syntax
We can observe that the line number is indicated with the error line
Run time errors:
- errors reported by Python Virtual Machine (PVM) during the byte code execution
- while syntax errors are compiler-time errors any errors which are syntactically correct and cannot be executed come under run time errors
- Any statement which PVM cannot be executed shall be reported as run time error
- Exception handlers are coded by programmers to handle the run time errors
- for example, let us check the output for the below Python block.
ls = ['0','1']
print(ls[2])
When we run the above block, it reports below error.
File "F:\python-progrm\Python-Tutorial-1.py", line 10, in <module>
print(ls[2])
IndexError: list index out of range
Logical errors:
- These unlike run time and compiler errors have no relation to the PVM or Python compiler
- These completely are a fault of the programmer because of which intended program output is not achieved
- Example could be while calculating an average of 10 elements, user adding 10 elements but dividing only by 9 gives a wrong output.
19 Comments
Nice Post. I like your blog. Thanks for Sharing.
ReplyDeletePython Training Institute in Noida
Thank you for the encouraging comment.
DeleteThanks for sharing nice blog. I have taken Embedded Development Services in India and their service is very good.
ReplyDeleteFor resolution to Norton scan error it is advisable to get the software removed from the system further the user should get the software reinstalled. For more information the user should get connected with the team of certified Norton technicians. There is no such issue that cannot be resolved by the Norton antivirus customer support number of the experts.
ReplyDeleteThansk For Good Posting Most powerfull Information But And Try It Kaspersky technical team the team can be reached for help through Emails, live chats and also through calls at https://www.pinterest.co.uk/pin/655836764474915279.
ReplyDeleteYour site is acceptable and your site contact is useful individuals can learn and take data here I am learnig heaps of think like I have an assistance related your site like yippee on the off chance that you confronting some probleme identified with hurray blunder so contact on yahoo support number uk and yahoo helpline number uk
ReplyDeleteTake help easily from kaspersky
ReplyDeletekaspersky support number uk
kaspersky contact number uk
kaspersky helpline number uk
you site is good people can take easliy from your site kaspersky hepline number is best service kaspersky toll free number uk
ReplyDeleteyahoo not working on mobile
ReplyDeleteyahoo support number uk
yahoo contact number uk
yahoo toll free number uk
yahoo helpline number number uk
ReplyDeleteyahoo intsant help uk
yahoo uk number for help uk
yahoo care helpline number uk uk
The blog has been written by a skilled and an experienced writing professional and thus it is helping out a lot of people.CLEAR NETFLIX VIEWING HISTORY ON LAPTOPS
ReplyDeleteThe blog has been written by a skilled and an experienced writing professional and thus it is helping out a lot of people.CLEAR NETFLIX VIEWING HISTORY ON LAPTOPS
ReplyDeleteUndoubtedly everyone who has the knowledge of website designing and developing would be able to understand the creativity that has been used by the professionals
ReplyDeletehere on the website. Reason If Netflix Is Not
Connecting On TV
The writer is advised to write more and more and also is advised to share all that writing here as that would bring more audience for the content. avast helpline number uk | avast support number uk | avast contact number uk
ReplyDeleteThe process to troubleshoot BullGuard antivirus error code 232 is an easy thing to be done for that, the user should check for program incompatibility also the program should be updated to the latest version. If required then to know more the user should get in touch with the team of technicians as and when needed.bullguard contact number uk bullguard toll free number uk | How to get data backup created through BullGuard
ReplyDeleteyahoo mail is provding good service for your divice. if you while using yahoo mail sometime you have to problem then you contact via YAHOO PHONE NUMBER 800-368-9067 CUSTOMER SERVICE UK
ReplyDeleteThe content is very informative and good for the reading, for fixing McAfee problems please take support from the trained experts team. Mcafee Helpline Number UK
ReplyDeleteThe content is very informative and good for the reading, for fixing McAfee problems please take support from the trained experts team. Mcafee Helpline Number UK
ReplyDeleteThe content is very informative and good for the reading, for fixing McAfee problems please take support from the trained experts team. Mcafee Helpline Number UK
ReplyDelete