Dec-15-2017, 03:06 AM
I get a none type object is not utterable error. I am not sure why.
def match(Home, Visitor, matchnum): print("Match", str(matchnum)) scorehome = int(input("Enter the number of points "+Home+" got in Match "+str(matchnum)+": ")) scorevisitor = int(input("Enter the number of points "+Visitor+" got in Match "+str(matchnum)+": ")) def printScoreCard(Home,Visitor,winhome,winvisitor): print(Home,winhome) print(Visitor, winvisitor) def wrong_score(): if ((scorehome > scorevisitor) and scorehome < 25): print("One team must score 25 points. Please enter scores again.") return False elif ((scorevisitor > scorehome) and scorevisitor < 25): print("One team must score 25 points. Please enter scores again.") return False elif ((scorehome > scorevisitor) and scorehome - scorevisitor < 2): print("One team must win by 2 points. Please enter scores again.") return False elif ((scorevisitor > scorehome) and scorevisitor - scorehome < 2): print("One team must win by 2 points. Please enter scores again.") return False elif scorehome > scorevisitor: winhome=winhome+1 return True else: scorevisitor > scorehome winvisitor= winvisitor+1 return True def startgame(): print("Welcome to the volleyball score program.") Home = input("Enter the home team's name: ") Visitor = input("Enter the visitor's team name: ") winhome = 0 winvisitor = 0 for i in range(5): while True: scorehome,scorevisitor=match(Home, Visitor,i+1) if wrong_score(): break if scorehome > scorevisitor: winhome=winhome+1 else: winvisitor=winvisitor+1 printScoreCard(Home,Visitor,winhome,winvisitor) if winhome>winvisitor: print(Home+" wins the game!") else: print(Visitor+" wins the game!") startgame()