![]() ![]() So in this latter version you could use x as an index into the list: iter_obj = my_list.Īlternatively, a slightly more pythonic version if you still need the iteration index (e.g. Range(.) returns a list/generator of indices (integers), so your for statement would iterate over integers for-iteration 0: x = 1 So your for statement iterates over these objects: for-iteration 0: x = 2 ![]() , my_list is equivalent to a shallow copied list of all elements starting from the 0-indexed 1. See this SO question:įor a list my_list of objects e.g. ![]()
0 Comments
Leave a Reply. |