Answer the question
In order to leave comments, you need to log in
Why does it show a Traceback error?
Here is an example code:
a = list(map(int, input().split()))
print(a)
Traceback (most recent call last):
File "путь к файлу", line 1, in <module>
bags = int(input())
ValueError: invalid literal for int() with base 10: '1 2 3'
Answer the question
In order to leave comments, you need to log in
There is no line in your code that the error refers to.
bags = int(input())
I recommend making sure that you run exactly the code that you provided. If you are running an IDE like pycharm, you may be running another open module.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question