Skip to content

Instantly share code, notes, and snippets.

@bymustfa
Created April 21, 2023 13:34
Show Gist options
  • Save bymustfa/498bda1ba4091169f8f00684f5753a5f to your computer and use it in GitHub Desktop.
Save bymustfa/498bda1ba4091169f8f00684f5753a5f to your computer and use it in GitHub Desktop.
Sayı tahmin etmeni sağlayan python kodu
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