Skip to content

Commit 1019e7b

Browse files
PYTH-12 Hangman not compelet Yet
1 parent aa18b1e commit 1019e7b

File tree

8 files changed

+115
-38
lines changed

8 files changed

+115
-38
lines changed

.idea/100_Days_in_python.iml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/profiles_settings.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/workspace.xml

Lines changed: 39 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import random
2+
3+
word_list = ["Ahmed", "Zeaad", "Eslam"]
4+
chosen_word = random.choice(word_list)
5+
print(chosen_word)
6+
7+
display = []
8+
Word_lenght = len(chosen_word)
9+
for _ in range(Word_lenght):
10+
display += "_"
11+
print(display)
12+
Guss = input("Guss a letter ").lower()
13+
for position in range(Word_lenght):
14+
letter = chosen_word[position]
15+
if letter == Guss:
16+
display[position] = letter
17+
print(display)
18+
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Compeleting our challenge
2+
import random
3+
4+
word_list = ["ahmed", "zeaad", "eslam"]
5+
chosen_word = random.choice(word_list)
6+
print(chosen_word)
7+
8+
display = []
9+
Word_lenght = len(chosen_word)
10+
for _ in range(Word_lenght):
11+
display += "_"
12+
print(display)
13+
14+
end_of_game = False
15+
16+
while not end_of_game:
17+
Guss = input("Guss a letter ").lower()
18+
for position in range(Word_lenght):
19+
letter = chosen_word[position]
20+
if letter == Guss:
21+
display[position] = letter
22+
print(display)
23+
if "_" not in display:
24+
end_of_game = True
25+
print("WOW, You Just Win!")

0 commit comments

Comments
 (0)