diff --git a/Python/Quiz Game/Readme.md b/Python/Quiz Game/Readme.md index 7a0f3ee..9c4f902 100644 --- a/Python/Quiz Game/Readme.md +++ b/Python/Quiz Game/Readme.md @@ -26,4 +26,4 @@ Displaying formatted output 📚 Author -Developed by RAMEEZ as a beginner Python project to improve interactive programming skills and logical thinking. \ No newline at end of file +Developed by RameezHiro as a beginner Python project to improve interactive programming skills and logical thinking. \ No newline at end of file diff --git a/Python/Quiz Game/main.py b/Python/Quiz Game/main.py index 4155b29..58f3899 100644 --- a/Python/Quiz Game/main.py +++ b/Python/Quiz Game/main.py @@ -1,5 +1,6 @@ print('Welcome to AskPython Quiz') + answer=input('Are you ready to play the Quiz ? (yes/no) :') score=0 total_questions=3 @@ -27,6 +28,7 @@ else: print('Wrong Answer :(') + print('Thankyou for Playing this small quiz game, you attempted',score,"questions correctly!") mark=(score/total_questions)*100 diff --git a/Python/Word_Scramble/Readme.md b/Python/Word_Scramble/Readme.md new file mode 100644 index 0000000..2a5a8a4 --- /dev/null +++ b/Python/Word_Scramble/Readme.md @@ -0,0 +1,19 @@ +🔤 Word Scramble Game + +A fun and simple Python word puzzle game where you have to guess the original word from its scrambled version!. This project is great for beginners who want to practice loops, conditionals, functions, and randomization in Python. + + +🎮 Game Description + +The program randomly selects a word from a predefined list. +It then scrambles the letters of the word and displays it to the player. +The player has 3 attempts to guess the correct word. +The game ends when the player guesses correctly or runs out of attempts. + + +🧩 Features + +✅ Randomly selects and scrambles words +✅ Limited attempts for guessing (default: 3) +✅ Provides feedback after each guess +✅ Displays the correct word if the player fails \ No newline at end of file diff --git a/Python/Word_Scramble/main.py b/Python/Word_Scramble/main.py new file mode 100644 index 0000000..8f61d08 --- /dev/null +++ b/Python/Word_Scramble/main.py @@ -0,0 +1,26 @@ +import random + + +def scramble_word(word): + return "".join(random.sample(word, len(word))) + +words = ["python", "developer", "programming", "challenge"] +word = random.choice(words) +scrambled = scramble_word(word) + +print("Scrambled word:", scrambled) + + +attempts = 3 +while attempts > 0: + guess = input("Guess the word: ").lower() + if guess == word: + print("Correct! ????") + break + else: + attempts -= 1 + print(f"Wrong! {attempts} attempts left.") + + +if attempts == 0: + print(f"Game over! The correct word was {word}.") \ No newline at end of file