# User console communication for Quiz CodeClub party Perth 2025-12-16
# rev 0.10  2025-11-30  initial release

def welcomeScreen():
    print('\nWhat level will we play in this Quiz?')
    print('1 = easy')
    print('2 = medium')
    print('3 = difficult')
    while True:
        answ = input('What level do we play? ')
        if len(answ) == 1 and answ in '123': break
        print('inavlid answer, please say again!\n')
    level = ('easy', 'medium', 'difficult')[int(answ)-1]
    print('We play level', level)
    return level


def presentQuestions(questions, answerss):
    answers_given = []
    for question, answers in zip(questions, answerss):
        print('\n', question)
        for idx, answer in enumerate(answers):
            print(idx+1, ':', answer)
        while True:
            choosen = input('The correct answer is: ')
            if len(choosen) == 1 and choosen in '1234': break
            print('invalid answer, try again')
        idx = int(choosen)-1
        answers_given.append(answers[idx])    
    return answers_given


def presentScore(score):
    print()
    if score: print('Gratulations, you had', score, 'good answers')
    else    : print('Sorry there were no good answers')  
