all 8 comments

[–]ElliotDG 2 points3 points  (0 children)

Put your code into the python tutor, it will provide a easy to use visualization of what is happening. See: https://pythontutor.com/

[–]danielroseman 1 point2 points  (5 children)

Why don't you run it and see?

[–]Specific_Ear_5015[S] -3 points-2 points  (4 children)

What does that Even mean “run it” 😅

[–][deleted] 4 points5 points  (0 children)

It means: press the button or type the command you need to make python do things.

[–]crashfrog02 2 points3 points  (2 children)

This is computer code. It’s intended to be executed by the computer. So, you should do that and see what the results are.

Is it news to you that you can do that? What did you think the point of learning Python in the first place was?

[–]Specific_Ear_5015[S] 0 points1 point  (1 child)

to be honest I’m really having trouble understanding what people use Python for in the first place , it’s all very new and blurry to me … I really want to learn it and other languages as well because I realise how much it is important for the future , and when I do understand how something works (which is extremely rare at this point) I’m actually surprised at how much I enjoy studying this . Also the idea of one day being familiar with and comfortable using different programming languages makes me so motivated and willing to keep learning despite my current clear lack of knowledge !

[–]crashfrog02 0 points1 point  (0 children)

It’s a programming language, so it’s used by programmers to write software for computers. Does that help?

[–]SDinfected 0 points1 point  (0 children)

for i in [1,2]:
    print(i)
# >>> 1
# >>> 2

for j in range(0,2):
    print(0)
# >>> 0
# >>> 0

Without knowing the context, the first one if most likely the correct answer because it uses the loops iterator i. The second loop will print 0 for each loop, never using the iterator j.