fork download
  1. lista = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
  2.  
  3. print(lista[1:5]) # [1, 2, 3, 4]
  4. print(lista[:5]) # [0, 1, 2, 3, 4]
  5. print(lista[1:]) # [1, 2, 3, 4, 5, 6, 7, 8, 9]
  6. print(lista[:]) # [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
Success #stdin #stdout 0.03s 9368KB
stdin
Standard input is empty
stdout
[1, 2, 3, 4]
[0, 1, 2, 3, 4]
[1, 2, 3, 4, 5, 6, 7, 8, 9]
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]