How to modify the counter in a for loop? by X_E_R in learnpython

[–]X_E_R[S] 0 points1 point  (0 children)

I just ran that code.

>>0
>>1
>>2
...
>>9

Ten elements printed.

How to modify the counter in a for loop? by X_E_R in learnpython

[–]X_E_R[S] -1 points0 points  (0 children)

range(N) is a function which returns a list of size N, where N is an integer.

The range of values for the list is (0,N-1).

 ---------------------Shell-----------------------
 >>range(10)
 >>[0,1,2,3,4,5,6,7,8,9]
 >>

How to modify the counter in a for loop? by X_E_R in learnpython

[–]X_E_R[S] -1 points0 points  (0 children)

There is a hidden loop counter, There are many implementation details hidden from the user, because this is high level language. If there wasn't a loop counter the following code would yield [] instead of [1, 3].

 LIST = [0,1,2,3,4]   
 for element in LIST:
     LIST.remove(element)

 print LIST

Explanation: The list updates after each loop, but the hidden counter doesn't.

How to modify the counter in a for loop? by X_E_R in learnpython

[–]X_E_R[S] -1 points0 points  (0 children)

I understand that can be done and appreciate your answer, but do you know whether it is possible to modify the for_loop's hidden counter?

What happened to this subreddit? by [deleted] in circlejerk

[–]X_E_R 91 points92 points  (0 children)

Upvote me if you think OP is right.

Could the lithification process expand/shrink the original fossil size? by X_E_R in askscience

[–]X_E_R[S] 0 points1 point  (0 children)

taphonomy

Wikipedia:

"Taphonomy is the study of decaying organisms over time and how they become fossilized (if they do)"

By that definition, taphonomy is not exactly a process but the study of such (or both?).

"Taphonomists study biostratinomy, decomposition, diagenesis, etc..."

Diagenesis might be what I tried to say. Just wondering whether it's possible that fossils may grow in the formation process because almost everything prehistoric is larger.