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 history of the present King of Great Britain is a history of repeated injuries and usurpations, all having in direct object the establishment of an absolut
how do u comfir email?
How do you solve this?
To create an MLA style Works Cited entry, list the author, last name first, and type the book title in italics. Suppose an author, George Pattison, wrote a nov
Which of the following is a situational attribution? Bella didn't study for the test because: A. she decided she would rather go out with Jacob B. Edward wanted
Sally's teacher asked her to classify a microscopic organism found in pond water. The FIRST characteristic Sally used to figure what kingdom the organism belong
Circumference and area of a circle, please help, would really appreciate it
A rectangular pyramid has a base measuring 4 in. on each side and an altitude of 6 in. What is its volume? cubic inches
8 is 20% of what number
Use Order of operations to solve. 105 - 7^2 + (72 divided by 9)