Confusing expression in python
If I have the list: lista=[99, True, "Una Lista", [1,3]] What does the following expression mean? mi_var = lista[0:4:2] ...
If I have the list: lista=[99, True, "Una Lista", [1,3]] What does the following expression mean? mi_var = lista[0:4:2] ...
This is a simple question about how Python handles data and variables. I've done a lot of experimenting and have Python mostly figured out, except this keeps tripping me up: [edit: I separated and rearranged the examples for clarity] Example 1: >>> a = [[1], 2] >>> a[0:1] [[1]] >>> a[0:1] = [[5]] >>> a [[5], 2] # The assignment worked...