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

what is aas congruence?
What did the Egyptians call the area that we now call Sudan?
A dealer sells a certain type of chair and a table for $40. He also sells the same sort of table and a desk for $83 or a chair and a desk for $77. Find the pric
What did the Egyptians call the area that we now call Sudan?
7 - 3 ( 5t - 10 ) = 67
Use the REMAINDER THEOREM to explain whether or not (x-2) is a factor of F(x)=x^4-2x^3+3x^2-10x+3
A dealer sells a certain type of chair and a table for $40. He also sells the same sort of table and a desk for $83 or a chair and a desk for $77. Find the pric
Find the LCM of 8,9, and 12
what is aas congruence?
What are the sides of the DNA ladder made of?