Ask Sawal

Discussion Forum
Notification Icon1
Write Answer Icon
Add Question Icon

How to Write a Python program to print a specified list after removing the 0th, 4th and 5th elements. (Python Programing Language)

1 Answer(s) Available
Answer # 1 #
1
color = ['Red', 'Green', 'White', 'Black', 'Pink', 'Yellow']
2
color = [x for (i,x) in enumerate(color) if i not in (0,4,5)]
3
print(color)
[8]
Edit
Query
Report
Uy Frank
MANIPULATOR OPERATOR