Last active
November 3, 2017 20:11
-
-
Save bakialmaci/0c23e47525962c87976518238208f6cf to your computer and use it in GitHub Desktop.
Hangingman_python3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
liste = ["araba","elma","mouse","kalem","bobin","masa","lamba","priz","bardak","silgi","kumbara","klavye","program","yazılım"] | |
secim = random.choice(liste) | |
kelime = [] | |
print(" TOPLAMDA",len(secim)-1,"ADET YANLIŞ HAKKINIZ BULUNMAKTADIR.") | |
for i in secim: | |
kelime.append(i) | |
true = [] | |
print(len(kelime),"Harf İçeren Bir Kelime") | |
for i in kelime: | |
true.append(i) | |
for i in range(0,len(kelime)): | |
true[i] = "*" | |
print(true) | |
sayac = 0 | |
print("Yanlış sayısı:", sayac) | |
def finish(): | |
print("BAŞARDINIZ !!!") | |
exit() | |
return | |
while sayac < len(secim)-1: | |
harf = input("Harf: ") | |
if harf in kelime: | |
for i in range(0,len(kelime)): | |
if harf == kelime[i]: | |
true[i] = harf | |
else: | |
sayac+=1 | |
print(true) | |
print("Yanlış sayısı:",sayac) | |
if true == kelime: | |
finish() | |
print("Kelimeniz --> ",secim) | |
print("Game Over !!!") | |
exit() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment