fork download
  1. import re
  2. line='0.2741564350068515+2.6100840481550604*^-10*I\n'
  3. print("({})".format(re.sub(r"(\*\^)|([.]?\*I)", lambda m: "e" if m.group(1) else "j", line.strip())))
Success #stdin #stdout 0.01s 8968KB
stdin
Standard input is empty
stdout
(0.2741564350068515+2.6100840481550604e-10j)