لعبة ملك وكتابة

import random
choice = input (“please,choice 1:Heads,tails\n”).lower()
ran=random.randint(0,1)
if ran ==0:
print (“it is tails”)
O= (“tails”).lower ()
if choice== O :
print (“you win”)
else :
print (“you lost”)
else :
print (“it is Heads”)
L = (“Heads”).lower()
if choice== L :
print (“you win”)
else :
print (“you lost”)

إعجابَين (2)

جميل بارك الله فيك :heart:


الكود بشكل منظم :

import random
choice = input ("please,choice 1:Heads,tails\n").lower()
ran=random.randint(0,1)
if ran ==0:
  print ("it is tails")
  O= ("tails").lower ()
  if choice== O :
    print ("you win")
  else :
    print ("you lost")
else :
  print ("it is Heads")
  L = ("Heads").lower()
  if choice== L :
    print ("you win")
  else :
    print ("you lost")
إعجابَين (2)

شكرا
ممكن اعرف حضرتك بتنظم الكود كده ازاى

3 إعجابات

العفو


الطريقه :

النتيجه :

print ("welcome")
3 إعجابات