r/PythonLearning • • Jul 11 '25

Code won't print

Post image

What's the error?(I'm a newbie)

115 Upvotes

86 comments sorted by

View all comments

8

u/Character-Comfort539 Jul 11 '25

4

u/Ill-Diet-7719 Jul 11 '25

Could there be a problem with visual studio?(I'm doin on it and everything's been fine)

4

u/Character-Comfort539 Jul 11 '25

There could be, IDE's can be a bit squirrelly to setup if you're not familiar with them and are new. I'd add something like `sdjflasjdfasjd` to the bottom of the file and see if the interpreter throws an error. Your other comments say "it doesn't print anything at all" but I'm not convinced anything is even running to begin with. Throwing a nonsense line into the file should give you an error. Just to be sure, save the file as like odd.py and run what's below in the terminal and let us know how it goes

python odd.py

4

u/undernutbutthut Jul 12 '25

Remember to save the code first then run it.

2

u/lusvd Jul 12 '25

just in case keep in mind that Visual Studio != vscode

2

u/ofSkyDays Jul 14 '25

If you have it often open and constantly sleep/wake pc, it could have developed a glitch. Idk it always happens whenever I do simple web dev stuff.

One time I had horizontal scrolling come out of nowhere, and I could it find the issue and nothing pointed to there being anything, but a clean shutdown and restart of vscode fixed it.

2

u/SizzlingSquigg Jul 11 '25

I appreciate the link with test.

OP, you can simplify, too. See https://www.online-python.com/cjIfx1YLwN

2

u/number-13 Jul 11 '25

Nice one bro.. I'm a newbie as wel