[Solved] How do I create a scoring system in Python? [closed]


def QuestionSet1():
    print("Challenge level 1 has being selected.")
    print("Can you translate these words into french?")
    a=input('Q1. Hello! :')
    score = 0
    if 'bonjour' in a.lower(): 
        score = score + 1
        print('Correct!')
    else:
        print('Wrong! '+'Its Bonjour')
        print('You have finished and scored', score, 'out of 10')

You would need make a reference to score before you give it a value.

You can also remove one of the if statements by converting the input to lower case and checking the lower case value.

solved How do I create a scoring system in Python? [closed]