Ask Question
7 November, 15:57

What is runtime error in Python? Provide an example

+2
Answers (1)
  1. 7 November, 17:14
    0
    If the program is syntactically correct means there are no syntax errors in the program the python interpreter will execute the program. But if the program exits unexpectedly then there exists a run-time error in the python program.

    For Example:-

    Accessing a list element which does not exists. divide by 0. Accessing a file which does not exists. Performing operation on incompatible types.

    For ex:-

    my_list=[1,34,7,3,7,8]

    print (my_list[6])

    This code will produce run-time error.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “What is runtime error in Python? Provide an example ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers