← Back to context Comment by pwdisswordfishy 1 month ago >>> "—".replace("—", "\u10EAD\u10EAC") 'ცDცC' Behold indeed. 5 comments pwdisswordfishy Reply vova_hn2 1 month ago This is really funny and I do feel ashamed for my laziness.I didn't expect ChatGPT to make such trivial mistake, although, I have no idea which model do they use on the free plan these days.The correct code is, of course: text.replace("—", "\U00010EAD\U00010EAC") ...in case anyone is curious. vova_hn2 1 month ago Curiously enough, after telling it "your code is broken, can you find the mistake?" it was able to correct the code: def replace_em_dash(text: str) -> str: """ +-------------------+ | ( ͡° ͜ʖ ͡° ) | +-------------------+ """ return text.replace("—", "\U00010EAD\U00010EAC") oxygen_crisis 1 month ago Might be a good idea in general to throw out a few preventative iterations of "Your code is broken, can you find the mistake?" before you even bother reading its initial output 2 replies →
vova_hn2 1 month ago This is really funny and I do feel ashamed for my laziness.I didn't expect ChatGPT to make such trivial mistake, although, I have no idea which model do they use on the free plan these days.The correct code is, of course: text.replace("—", "\U00010EAD\U00010EAC") ...in case anyone is curious. vova_hn2 1 month ago Curiously enough, after telling it "your code is broken, can you find the mistake?" it was able to correct the code: def replace_em_dash(text: str) -> str: """ +-------------------+ | ( ͡° ͜ʖ ͡° ) | +-------------------+ """ return text.replace("—", "\U00010EAD\U00010EAC") oxygen_crisis 1 month ago Might be a good idea in general to throw out a few preventative iterations of "Your code is broken, can you find the mistake?" before you even bother reading its initial output 2 replies →
vova_hn2 1 month ago Curiously enough, after telling it "your code is broken, can you find the mistake?" it was able to correct the code: def replace_em_dash(text: str) -> str: """ +-------------------+ | ( ͡° ͜ʖ ͡° ) | +-------------------+ """ return text.replace("—", "\U00010EAD\U00010EAC") oxygen_crisis 1 month ago Might be a good idea in general to throw out a few preventative iterations of "Your code is broken, can you find the mistake?" before you even bother reading its initial output 2 replies →
oxygen_crisis 1 month ago Might be a good idea in general to throw out a few preventative iterations of "Your code is broken, can you find the mistake?" before you even bother reading its initial output 2 replies →
This is really funny and I do feel ashamed for my laziness.
I didn't expect ChatGPT to make such trivial mistake, although, I have no idea which model do they use on the free plan these days.
The correct code is, of course:
...in case anyone is curious.
Curiously enough, after telling it "your code is broken, can you find the mistake?" it was able to correct the code:
Might be a good idea in general to throw out a few preventative iterations of "Your code is broken, can you find the mistake?" before you even bother reading its initial output
2 replies →