Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: trying to change the index variable in a for loop #11

Closed
tukkek opened this issue Aug 31, 2017 · 2 comments
Closed

Feature request: trying to change the index variable in a for loop #11

tukkek opened this issue Aug 31, 2017 · 2 comments

Comments

@tukkek
Copy link

tukkek commented Aug 31, 2017

Hello! After finding a link to your project today on reddit I have decided to give another go at a previous project of mine, now using your document format as inspiration! While doing my research I have come across something that I think would fit well in your list. Here it is:

for i in range(10):
    print(i)
    i = 5             # this will not affect the for-loop
                      # because i will be overwritten with the next
                      # index in the range

This is taken from the Python manual itself, which in itself makes it notable. This might not come as a surprise to anyone who started coding with Python - but for people coming from C++, Java or similar, this is very much something they'd expect to work, giving how for loops work in these languages.

Hope you like this :) Source: https://docs.python.org/3/reference/compound_stmts.html#the-for-statement

By the way, if you have the time to read my own work and maybe let me know if I'm missing anything, I'd be very honored to have you onboard! Here is the link for my current work-in-progress version: https://github.com/tukkek/notablepython/blob/master/README.md

@satwikkansal
Copy link
Owner

Hey @tukkek, Thanks for your suggestion. I've added the example in the commit ba2238cf . Feel free to suggest corrections (if any).

By the way, if you have the time to read my own work and maybe let me know if I'm missing anything, I'd be very honored to have you onboard! Here is the link for my current work-in-progress version: https://github.com/tukkek/notablepython/blob/master/README.md

Sure, I looked over your project and it seems very interesting. Right now, I'm a bit overwhelmed with response on this project and my ongoing campus placements. But I'll definitely sit back some day, carefully read through your work, and try to contribute to the project :) Thanks again!

@tukkek
Copy link
Author

tukkek commented Sep 3, 2017

Sure thing Satwik, feel free to drop by whenever! You'll be more than welcome!

BenSt099 added a commit to BenSt099/wtfpython that referenced this issue Aug 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants