1

I have recently downloaded the Pycharm IDE. I have tried using the simple code:

a = int(input("Enter a number:"))
b = int(input("Enter another number:"))

Pycharm asks for a number, and I enter 6.

Enter a number:6

Then Pycharm sends this:

Enter another number:Traceback (most recent call last):
  File "C:/Users/justi/comp-sci_11_final/main.py", line 16, in <module>
    b = int(input("Enter another number:"))
ValueError: invalid literal for int() with base 10: ''

Process finished with exit code 1

It seems like it is not letting me input another value, as the string in the error is empty, and the error comes from "b = int(input())" but I am not sure why.

I am using python 3.7, and Pycharm 2018.3. It works perfectly fine in repl.it, so it seems that Pycharm is the guilty party.

Thanks for the help!

EDIT: Moving it to a new program worked, but I have experienced the issue again afterwards. Does anyone know why this is happening?

Juicetin
  • 220
  • 1
  • 10
  • 1
    have you tried the solutions posted in this question: https://stackoverflow.com/questions/35829176/input-in-python-does-not-wait-for-my-input-in-pycharm ? – toom501 Dec 08 '18 at 20:52
  • I did try the first and last ones, but somehow I missed moving it to a new file. That fixed the problem. Thanks and sorry. – Juicetin Dec 08 '18 at 20:57
  • Oh ok, perfect :) – toom501 Dec 08 '18 at 20:59
  • I am getting the erreor again. I can fix it, but it is kind of annoying. Does anyone know a way to fix or prevent this from happening? – Juicetin Dec 09 '18 at 20:19
  • it's probably better if you update/edit the question, maybe someone knows it – toom501 Dec 10 '18 at 10:17

0 Answers0