# -*- coding: utf-8 -*- """WordJumble Automatically generated by Colab. Original file is located at https://colab.research.google.com/drive/15l1pcWotDAP9FFZKbStGfOd1SF_LMsWs """ 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)