Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

One way to do this would be to replace each digit with its double:

2 + 2 = 4

becomes

5 + 5 = 10

In Python, you could write:

print("2 + 2 = 4".replace("2", "5").replace("4", "10")) 

This will output:

5 + 5 = 10