def main():
    score = 0

    firstquestion = input("What is 2+2?")

    if firstquestion == "4":
        score += 1
    else:
        score -= 1

    secondquestion = input("What is 1+1?")

    if secondquestion == "2":
        score += 1
    else:
        score -= 1

    if score < 0:
        score = 0
    
    print("You got " + str(score) + " out of 2.")

main()
You got 2 out of 2.