Internal error: invalid literal for int() with base 10: '' when opening main dashboard

Computers store numbers in a variety of different ways. Python has two main ones. Integers, which store whole numbers (ℤ), and floating point numbers, which store real numbers (ℝ). You need to use the right one based on what you require. This error message invalid literal for int() with base 10 would seem to indicate that you are passing a string that’s not an integer to the int() function . In other words it’s either empty, or has a character in it other than a digit.

You can solve this error by using Python isdigit() method to check whether the value is number or not. The returns True if all the characters are digits, otherwise False .

val = "10.10"
if val.isdigit():
  print(int(val))

The other way to overcome this issue is to wrap your code inside a Python try…except block to handle this error.

Or if you are trying to convert a float string (eg. “10.10”) to an integer, simply calling float first then converting that to an int will work:

output = int(float(input))