Traceback (most recent call last):
File "C:\Users\HP\AppData\Local\Programs\Python\Python37-32\codejam2.py", line 1, in <module>
n=int(input())
ValueError: invalid literal for int() with base 10: ''
This is the error that I am getting
Traceback (most recent call last):
File "C:\Users\HP\AppData\Local\Programs\Python\Python37-32\codejam2.py", line 1, in <module>
n=int(input())
ValueError: invalid literal for int() with base 10: ''
This is the error that I am getting
Other people pointed already out, that in order to keep Stack overflow efficient it is important to have all essential information in the question.
Your question is very minimalist and it's normally better to show the surrounding code and to explain what you want to achieve and how the error happened.
However in this particular case all the information for a basic answer is already in the error message.
line 1 reads user input and then tries to convert it to a number.
It seems you just pressed enter, which means the result of input()
is an empty string.
An empty string cannot be converted to an integer.
if you had entered "hello" the error message would have been
invalid literal for int() with base 10: 'hello'
So just enter a text that can be converted to a number and your program should run successfully.
If not you might want to look at try / except
and write code, that detects if the input cannot be converted and react accordingly (depends on your program to know what is expected)