Guess the anagram game

Create a program that reads a list of words from a file and
shuffles the letters of each word to create an anagram.
The program should then display the anagram and
ask the user to guess the original word.

import random
Word_Bracket = ['you','statistics','satisfaction','purification','hot','goat',
                'amsterdam','hustle','catfish','lamb','western','question','carnivour',
                'lost','ghosting','drought','zeal','now','tip']

# select a random word
s = Word_Bracket[random.randint(0,len(Word_Bracket)-1)]

# Code for shuffling letters of the word i.e. creating an anagram
anagram = ['']*len(s)

for i in s:
    pos = random.randint(0,len(s)-1)
    while(anagram[pos] !=''):
        pos = random.randint(0,len(s)-1)
    anagram[pos] = i
    a = ''.join(anagram)

# main code
state = True

while(state):
    print(f'Guess the original word:{a}')
    ans = input()
    if ans == s:
        print('Congratulations !!!!')
        print(f'You guessed the word **{s}** correct')
        state = False
    else:
        # to show which letters are guessed at right and wrong positions
        correct_pos =[]
        wrong_pos =[]
        for i in range(len(s)):
            if ans[i] == s[i]:
                correct_pos.append(ans[i])
            else:
                wrong_pos.append(ans[i])
        print('Wrong Answer')
        print('correct guesses:',correct_pos)
        print('wrong guesses:',wrong_pos)
        res = input('Want to try again (y/n):')
        if res == 'n':
            print('Try again next time')
            state = False
Guess the original word: tsenuoiq
Wrong Answer
correct guesses: ['u', 'e', 't', 'i', 'o', 'n']
wrong guesses: ['s', 'q']
Guess the original word: tsenuoiq
Congratulations !!!!
You guessed the word **question** correct
2 Likes

@kharshavardhan31
Thanks for sharing
Keep it up. Nice❤️