Change while number or operator != "finish":
to while number != "finish" and operator != "finish":
.
while number or operator != "finish":
first looks if bool(number)
is True
(this will be True
when the string contains something), then looks if operator
is unequal "finish"
, and then looks if one of the results is True.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…