import random def scramble_word(word): word_list = list(word) random.shuffle(word_list) return ''.join(word_list) def play_game(words): score = 0 for word in words: scrambled_word = scramble_word(word) print(f"Scrambled word: {scrambled_word}") guess = input("Your guess: ") if guess.lower() == word.lower(): print("Correct!\n") score += 1 else: print(f"Wrong! The correct word was '{word}'.\n") print(f"Game over! Your final score is {score} out of {len(words)}.") words = ["python", "developer", "chatgpt", "algorithm", "keyboard"] play_game(words)