Skip to content

Commit 1c89b1c

Browse files
Merge pull request #2816 from avinashkranjan/deepsource-transform-0c8b212a
format code with autopep8
2 parents ff95d84 + 11f225a commit 1c89b1c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Guess the Word Game/GuesstheWordGame.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
import random
22

3+
34
def choose_random_word():
4-
words = ["apple", "banana", "cherry", "grape", "orange", "watermelon", "kiwi", "mango"]
5+
words = ["apple", "banana", "cherry", "grape",
6+
"orange", "watermelon", "kiwi", "mango"]
57
return random.choice(words)
68

9+
710
def display_word(word, guessed_letters):
811
display = ""
912
for letter in word:
@@ -13,6 +16,7 @@ def display_word(word, guessed_letters):
1316
display += "_"
1417
return display
1518

19+
1620
def guess_the_word():
1721
print("Welcome to Guess the Word game!")
1822
secret_word = choose_random_word()
@@ -49,5 +53,6 @@ def guess_the_word():
4953
print("Game over! You ran out of attempts.")
5054
print(f"The word was: {secret_word}")
5155

56+
5257
if __name__ == "__main__":
5358
guess_the_word()

0 commit comments

Comments
 (0)