for answer in QF:
ans = "{:.2f}".format(answer)
if ans in "0.00j":
print(ans.replace("0.00j", ""))
else:
print(ans)
만약 답에 0.00j이 있으면 그걸 삭제하고 출력해야 해서 replace 함수를 사용해봤는데 자꾸
Calculated answer is(are): -3.73+0.00j -0.27-0.00j
이런식으로 0.00j가 그대로 출력되네요.. 뭐가 문제인걸까요? 파이썬 고수님들 도와주세요!