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

Oh god OH NO WHAT THE HELL IS HAPPENING
Mark all of the following that may be reasons why a composer would choose to orchestrate music in a specific manner.
why did the spanish support exploration and colonization ?
An airplane is flying at 200 m/s at an angle of 30o north of east. How fast is the plane flying North? Please show how you got your answer.
Does this graph show a function? Explain how you know. A. Yes; the graph passes the vertical line test. B. No; there are y-values that have more than one x-valu
can someone help me
How much of the circle is shaded? Write your answer as a fraction in simplest form.
Define environment education. W "Clean and healthy environment makes our life healthier." Justify this statement.​
Helpppppppp nowwwwww
what equals (−8)+(−14)+30