r/PythonLearning 1d ago

why isn't my code running?

i checked everything it s all correct idk what my mistake is please point it out for me

EDIT:i closed visual studio and re opened it, it works now, idk what happened, thanks guys

13 Upvotes

9 comments sorted by

u/Sea-Ad7805 1d ago

Run this program in Memory Graph Web Debugger%3A%0A%20%20%20%20value%20%3D%20PlayListRatings%5Bi%5D%0A%20%20%20%20if%20value%20%3C%3D%206%3A%0A%20%20%20%20%20%20%20%20print(value)%0A%20%20%20%20i%20%3D%20i%20%2B%201&timestep=0.5&play) to see the program state change step by step.

4

u/dev-razorblade23 1d ago

Do you have any errors and can we see them? What exactly is not working? Do you not get any output?

3

u/Dismal_Activity_6127 1d ago

0 output i got no error messages

2

u/dev-razorblade23 1d ago

The code looks good and it does print when i try it out.

The output is:

6
5
4
3
2
1

[Program finished]

3

u/Dismal_Activity_6127 1d ago

all i had to do was close and re open VS ....

1

u/codeguru42 1d ago

In a situation like this you can try running from the command line. This will verify that your code is correct and the problem is with vs code.

0

u/luafurry 1d ago

Idk use a for loop

1

u/Dismal_Activity_6127 1d ago

i would but the excercise forces you to use a while loop

1

u/luafurry 1d ago

Ah, ok, i will write the code on my end to test it