Created
April 21, 2023 13:34
-
-
Save bymustfa/498bda1ba4091169f8f00684f5753a5f to your computer and use it in GitHub Desktop.
Sayı tahmin etmeni sağlayan python kodu
This file contains hidden or 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 | |
rasgeleSayi = random.randint( 1, 1000 ) | |
hak = 10 | |
def sayiGir(): | |
global hak | |
print("Sayı Gir:..") | |
sayi = input() | |
sayi = int(sayi) | |
if hak > 0: | |
hak = hak - 1 | |
if rasgeleSayi == sayi: | |
print("KAZANDIN") | |
hak = 0 | |
elif sayi < rasgeleSayi: | |
print("Yukarı") | |
elif sayi > rasgeleSayi: | |
print("Aşağı") | |
else: | |
print("KAYBETTİN") | |
print("===== KALAN HAKKIN: ", hak , " ======= ") | |
else: | |
print("HAKKIN BİTTİ KAYBETTİN") | |
while hak > 0: | |
sayiGir() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment