-5

我收到一条错误消息,提示 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")
4

1 回答 1

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

于 2013-06-05T21:01:15.607 回答