代码实现:
#coding = utf-8
while 1:
result=0.0
A = input("Please input a number as A:")
B = input("Please input a number as B:")
if A.isdigit() and B.isdigit():
if A>B:
print("A>B","A=",A,"B=",B)
elif A<B:
print("A<B","A=",A,"B=",B)
else:
print("A=B","A=",A,"B=",B)
elif A in 'e,E':
break
elif B in 'e,E':
break
elif A.isalpha():
print("Please input a number:")
elif B.isalpha():
print("Please input a number")