我收到一条错误消息,指出sum1未定义
def zodiacMatch(sum1, sum2):
sum1 = input("please enter your zodiac number")
sum2 = input("please enter your other number")
if sum1 + sum2 <= 7:
print "low compatibility"
#MAIN#
zodiacMatch(sum1, sum2):
sum1 = input("please enter your zodiac number")
sum2 = input("please enter your other number")
答案 0 :(得分:2)
试试这个:(如果你的Python版本低于3.x. python --version
来检查)
def zodiacMatch(sum1, sum2):
if sum1 + sum2 <= 7:
print "low compatibility"
#MAIN#
sum1 = input("please enter your zodiac number")
sum2 = input("please enter your other number")
zodiacMatch(sum1, sum2):
我希望这会有很好的业力:D