r/stackoverflow • • Aug 24 '24

Question Quick python question

I was following a pygame tutorial and the guy said to write this code to make multiple lines with this for loop. But I don't get how it works to insert multiple values in the range() parameter. I mean, what does python "think" when reading this code? I just know 66 is where i want to start to draw, 804 where i want to end and 67 the space between lines but what's the logic?

for x in range(66,804,67):       
        pygame.draw.line(screen,BLACK,[x,0],[x,500],3)
    return(0)
9 Upvotes

4 comments sorted by

View all comments

Show parent comment

1

u/PutRddt Aug 24 '24

Ooh of course. I know basic C and I don't know how I couldn't think of this, lol. Thank you