lululoveee1486 lululoveee1486
  • 10-12-2020
  • Computers and Technology
contestada

Write a program that will remove "May" from the list using .Pop and .Index methods.(5pts) GIVEN: lst=["January", "February", "March", "April", "May", "June"]

Respuesta :

MrRoyal
MrRoyal MrRoyal
  • 12-12-2020

Answer:

This question is answered in Python

lst=["January", "February", "March", "April", "May", "June"]

index = lst.index('May')

lst.pop(index)

print(lst)

Explanation:

This initializes the list

lst=["January", "February", "March", "April", "May", "June"]

This gets the index of May

index = lst.index('May')

This removes "May" from the list using pop()

lst.pop(index)

This prints the updated list

print(lst)

Answer Link

Otras preguntas

"The difference between four-fifths of a number and 11 is -46."
UGA is America’s _______ _________ university.
The radius of the base of a cylinder is decreasing at a rate of 121212 kilometers per second. The height of the cylinder is fixed at 2.52.52, point, 5 kilometer
Please help me thanks please
The Polish guard at Auschwitz is a complex character because he changes during the course of the book he is young and smiling his speech is difficult to underst
Read the excerpt from "To One in Paradise," by Edgar Allan Poe. Thou wast all that to me, love, For which my soul did pine- A green isle in the sea, love, A fou
Why did the federal government establish a trade embargo with Cuba? A. to encourage a free trade zone among Caribbean nations B. to promote the foreign policy
please help What is the slope of the line? m =
کن الفاظ کا مخفف ہےOIC
Helppp me plssssss 49 points