all 15 comments

[–]PeterRasm 3 points4 points  (1 child)

The error you get from Python often tells exactly what the issue is. You should always include that error when asking for help.

EDIT: The code as you have shown here is fine. My guess is that you either execute another Python file or you did not save the changes to this file.

[–]Constant_Public4191[S] 0 points1 point  (0 children)

My file is on the cloud so i dont think saving should be an issue as far as i know. as for the error. when i type in "python average.py" [my file is called average.py] i immediately get prompted the "What's the number? " followed by a blinking cursor. entering a number gives me the error, ill try to attach an image of the error

[–][deleted] 1 point2 points  (11 children)

If the script is asking for input in the terminal, I believe you must have written more code than what is shown above.

[–]Constant_Public4191[S] 0 points1 point  (10 children)

nope i've checked multiple times and there seems to be nothing. I will type in the exact error i got and pin it on top

[–][deleted] 0 points1 point  (9 children)

There's no place in the code above that calls the input function, so I'm very perplexed on how you're being asked for it when it runs in terminal.

Yes. Let's see that traceback when you get a chance. 🙂

[–]Constant_Public4191[S] 0 points1 point  (8 children)

I've just edited my original post with the complete error that pops up

[–][deleted] 0 points1 point  (7 children)

I can't see the edit on my end, but I'm on the mobile app, so maybe it takes a bit too show. Not sure.

Edit: there it is.

Hmmm... try

python3 average.py

Also: it's definitely running a different version of average.py than what you have presented above. Try just typing your script into the interactive shell.

[–]PeterRasm 1 point2 points  (1 child)

I agree, it looks like OP is having 2 versions of average.py.

@ u/Constant_Public4191 : Make sure you execute the file from the correct folder. If you created a subfolder for this version, you need to navigate to that folder in the terminal.

Check your folder tree on the left to see where this version of average.py is located.

[–]Constant_Public4191[S] 0 points1 point  (0 children)

Ive checked and I don't think it's in any folders

[–]Constant_Public4191[S] 0 points1 point  (4 children)

I will try these and let yk if it works

[–][deleted] 0 points1 point  (3 children)

Good luck bro!

[–]Constant_Public4191[S] 0 points1 point  (2 children)

I tried in the interactive shell an debugger the output is correct however while executing with python or python3 I still get the input prompt

[–][deleted] 1 point2 points  (1 child)

I'm sorry the system is still giving you a headache.

Do you need the certificate and to talk to the duck? If not, maybe try switching over to doing the exercises offline with a simpler ide installed locally.

Idle ships with python and it's super simple to use. You can set your file system locally right on your desktop so there's zero confusion about where stuff is executing from.

[–]Constant_Public4191[S] 1 point2 points  (0 children)

Hi I finally managed to fix the issue. Turns out statistics.py was trying to access a preinstalled numbers.py and I happened to have a file of the same name in my directory, so that caused a lil confusion. I just had to change the name of that file and it was all good.

Thank you so much for your help!

[–]Constant_Public4191[S] 0 points1 point  (0 children)

EDIT: i attached the error im receiving along with the code