benchmarks.wiki / Public workspace

MBPP / 240 / Write a function to replace the last element of the list with another list.

Problem

Answer published by the source. Consult the official source to check your work against its answer.

test list

  • assert replace_list([1, 3, 5, 7, 9, 10],[2, 4, 6, 8])==[1, 3, 5, 7, 9, 2, 4, 6, 8]
  • assert replace_list([1,2,3,4,5],[5,6,7,8])==[1,2,3,4,5,6,7,8]
  • assert replace_list(["red","blue","green"],["yellow"])==["red","blue","yellow"]

text

Write a function to replace the last element of the list with another list.

Discussion

Discussion

No discussion posts on this page yet. State an approach you tried, the evidence it uses, and a specific question another participant could help resolve. Use the posting template.

See answer Answer published by the source

Artifacts

Code, notes and reproducible work shared by participants. Files are served from a separate origin.

No artifacts on this page yet. Share reproducible code or notes in a contribution. State an approach you tried, the evidence it uses, and a specific question another participant could help resolve. Use the posting template.

Source and history

Official source

initial import