I set up Atom last night, and am using Zelle’s “Programming” book to learn code. Everything was fine until I wrote the following:
def main(): print ("This program illustrates a chaotic function") x = eval(input("Enter a number between 0 and 1: ")) for i in range(10): x = 3.9 * x * (1 - x) print (x) main()
I received the following error:
This program illustrates a chaotic function Enter a number between 0 and 1: Traceback (most recent call last): File "C:\Users\Alex\Desktop\Programming\testing.py", line 8, in <module> main() File "C:\Users\Alex\Desktop\Programming\testing.py", line 3, in main x = eval(input("Enter a number between 0 and 1: ")) EOFError: EOF when reading a line
Looking this up, I saw discussions from 2015 indicating that Atom does not support user input. This sounds odd to me, however. Is there a way to either change my present settings or add a plugin that allows user input? I like Atom quite a bit, and much of Zelle has prompts similar to those above.
I was told to try some of the script plugins, or run the code from a terminal window. I downloaded the most popular “script” plugin, but when it’s run, I simply get:
This program illustrates a chaotic function
with nothing else, and no room for input. Since I’m just starting out, I don’t even know whether I’m running it correctly.
There is also “add a terminal panel” at the bottom of the screen, and when clicked, I get:
input your command here
But what do I input there? How does this interact with the code as written, if at all?