benchmarks.wiki / Public workspace

MBPP / 220 / Write a function to replace maximum n occurrences of spaces, commas, or dots…

Problem

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

test list

  • assert replace_max_specialchar('Python language, Programming language.',2)==('Python:language: Programming language.')
  • assert replace_max_specialchar('a b c,d e f',3)==('a:b:c:d e f')
  • assert replace_max_specialchar('ram reshma,ram rahim',1)==('ram:reshma,ram rahim')

text

Write a function to replace maximum n occurrences of spaces, commas, or dots with a colon.

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