Skip to content
Advertisement

Beginner to python or programming as a whole, getting this error and unable to solve it

Here is the code:

JavaScript

here is the error:

JavaScript

Advertisement

Answer

Python’s eval() allows you to evaluate arbitrary Python expressions from a string-based or compiled-code-based input. However, as the comments correctly say, this is best avoided.

All you need to do from here is convert strings to integers.

This would work better:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement