I’m looking for a way to code a program that calculates the input for given result and sanitizing rules in python/or as a concept.
For example, there are 2 given rules:
Replace “(=” to “(!–”
Replace “=)” to “=–)”
The result should be:
“(=abc=)”
I’m looking for the input.
Do you have an idea how to solve this problem with a program?
The result can’t be “(=abc=)” since “(=” and “=)” would’ve been replaced.
Don’t you mean that for example you have “(!–abc=–)” and want to know what was entered before?
I think you can do that with a simple if statement if I read it right.
like this
new_thing = None
for parts in inputs:
if parts == (!:
new_thing .append(part you want
elif parts == =)
new_thing.append(part you want)
else:
new_thing.append(parts)