0

I am writing a program that replaces exclamation marks that are at there end of the string with Bork Bork Bork!!

I have tried using the replace() function but that replaces exclamation marks in the middle of a string. eg.

output = ("Hello! coder").replace("!", ". Bork Bork Bork!")

Would output

print(output)

Hello. Bork Bork Bork!! coder

When it should only replace "!" with "Bork Bork Bork" When it is at the END of a string.

Thank you.

tian 2.0
  • 1
  • 6

0 Answers0