+ 3
I'm new need help please.
Why does this work in python consol but not when I try to open it in .py? https://code.sololearn.com/c359SPZ50ciI/?ref=app
14 Answers
+ 6
It works when I tried it, where did you try it and failed?
+ 6
I hope you can find your answer in the following link, I am assuming you're running Windows, as you are using Notepad++.
https://stackoverflow.com/questions/1522564/how-do-i-run-a-JUMP_LINK__&&__python__&&__JUMP_LINK-program
This is just as far as I can go to help you, as I only learn with my phone, not on a PC, but do not fear, plenty of skillful Python coders here, they just haven't seen your question yet, hope you can find a solution for your problem :)
Hth, cmiiw
+ 6
@Gordie mate,
Thanks for being here while I was not, got some things to do, didn't get the chance to check out around :)
@Shance890,
Glad to hear you found the solution, when I tried your code in Playground it worked, so I didn't think it was indentation issue, good job :)
+ 6
@Gordie mate,
That's true, indeed copy-paste can raise issues, especially if it was copied from web browser, I have seen at least two friends here went into trouble from having invalid characters copied with their code, and given Python being strict with indentation, we need to be more careful with that.
Big Thanks :)
+ 2
When I write it on notepad++ and Save it as a .py file
+ 2
Yea you're right... Thanks
+ 2
I can't really see how this will help me.
+ 2
I did read it. It's just for some reason that code didn't want to work. I've found a way better way to code want I wanted anyway. I just retyped the code and now it works. Maybe I had some syntaxes problems somewhere. Anyway thanks.
+ 2
i believe you have to doubleclick in Windows to excute your .py script.
you can use idle, open your script in idle editor and press f5.
you can use 'cmd' too for executing your script.