def dragon_encode(input_data) -> str:
    """ Takes an initial state (the input_data) and then applies these transformations:
     - Call the data you have at this point "a".
     - Make a copy of "a"; call this copy "b".
     - Reverse the order of the characters in "b".
     - In "b", replace all instances of 0 with 1 and all 1s with 0.
     - The resulting data is "a", then a single 0, then "b".
     
     As a result, each transformation returns a str that is 2n+1 in length """
    part_a = input_data
    part_b = part_a[::-1].replace("0", "x").replace("1", "0").replace("x", "1")
    result = part_a + "0" + part_b
    return result