+ 1

Python: having two ASCII codes in one string

The code runs correctly except in point 3, where I created a string with two codes, but they are not replaced, how can I fix? https://code.sololearn.com/cZA2apT2PmDa/?ref=app

28th Jan 2022, 9:49 PM
Mick
Mick - avatar
3 Réponses
+ 1
ravilnicki What a fool! Thank you!
28th Jan 2022, 10:43 PM
Mick
Mick - avatar
+ 1
Also, I recommend only using try blocks to really handle errors. In this case, point 3 generated an error which clearly showed what ravilnicki explained, but the try block made that invisible. Instead, I suggest checking the variables to decide whether to replace the string or not - which is the try block decision. Keep errors visible when at all possible. And get used to read them.
29th Jan 2022, 1:54 AM
Emerson Prado
Emerson Prado - avatar
0
Ok, thanks for your help and advice, I publish the code https://code.sololearn.com/cJAgj2hEy2AZ/?ref=app
29th Jan 2022, 11:12 AM
Mick
Mick - avatar