What are RuntimeErrors in Python?


A syntax error happens when Python can't understand what you are saying. A run-time error happens when Python understands what you are saying, but runs into trouble when following your instructions. This is called a run-time error because it occurs after the program starts running.

A program or code may be syntactically correct and may not throw any syntax error. This code may still show error after it starts running.

The given code can be corrected as follows

a = input('Enter a number:')
b = input('Enter a number:')
c = a*b
print c

The output we get is as follows

"C:/Users/TutorialsPoint1/~.py"
Enter a number:7
Enter a number:8
56

Updated on: 27-Sep-2019

482 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements