Write a Python program to print a specified list after removing the 0th, 4th and 5th elements

  • برمجة
  • برمجة بايثون

 Write a Python program to print a specified list after removing the 0th, 4th and 5th elements.

الأجوبة

color = ['Red', 'Green', 'White', 'Black', 'Pink', 'Yellow']
color = [x for (i,x) in enumerate(color) if i not in (0,4,5)]
print(color)
هل كان المحتوى مفيد؟

تبحث عن مدرس اونلاين؟

محتاج مساعدة باختيار المدرس الافضل؟ تواصل مع فريقنا الان لمساعدتك بتأمين افضل مدرس
ماهو التخصص الذي تبحث عنه؟
اكتب هنا...