-2

Sorry for my English, Is there any way to print a list like this,

list = ["a","b","c","d","e"]

to

list_1 = ["a","c","e"]
Malar
  • 1
  • 1
  • Does this answer your question? [Understanding slice notation](https://stackoverflow.com/questions/509211/understanding-slice-notation) – Pranav Hosangadi Nov 12 '20 at 18:30

1 Answers1

0

From what I understand you mean to convert list to list_1. We can do it through slicing.

list = ["a","b","c","d","e"]
list_1 = list[::2]
print(list_1)
Dharman
  • 30,962
  • 25
  • 85
  • 135