For loop in python
What is the different thing between 'i for i' and 'for i' ?
Aah, okay, in comprehensions, I see!
The second one... exists. ;-) Where did you find 'i for i'?
"i for i" can be used to easily make lists or other iterables, where each item follows a certain logic. With timeit.timeit I discovered that "i for i" can take a large list without it even affects it's generation speed much, which means that "i for i" can be faster than "for i". "i for i" only supports one line statements, but that can be fixed by functions. "for i" loops supports multiple lines and can increase readability.
I have made a calculator in which my % (Percentage) not work correctly for 100%50 or 100%20.
Python palindrome challenge.
Number of Ones ( C++ ) question!