- 8 Ocak 2017
- 140
- 2
Şimdi sorunum şöyle, normalde böyle örnekler yapmayı severim, bu sefer taş kağıt makas örneğini yaptım fakat çalıştırınca input edeceğimiz kısım gelince, ne yazarsak yazalım donuyor kalıyor. Aşağıda görselide ekledim yardımcı olursanız çok teşekkür ederim sağ olun şimdiden.
Kod:
import random
options = ["taş","kağıt","makas"]
Rock = options[0]
paper = options[1]
scissors = options[2]
user_selection = """
If you selection rock; Rock
If you selection paper; paper
IF you selection scissors; scissors
exit programs press in "x"
"""
selection = input(user_selection)
machine_select = random.choice(options)
while True:
if selection==Rock:
if machine_select==Rock:
print(f"Selection computer {Rock}, You selection {Rock}, Result : Draw, try again")
elif machine_select==paper:
print(f"Selection computer {paper}, You selection {Rock}, Result : You win!..., felicitate..")
else:
print(f"Selection computer: {scissors}, You selection {Rock}, Result = You Lost :(,try again :)")
if selection==paper:
if machine_select==paper:
print(f"Select the computer {paper}, You selection {paper}, Result : Draw, try again.")
elif machine_select==Rock:
print(f"Select the computer {Rock}, You selection {paper}, Result : You Win!..., felicitate..")
else:
print(f"Select the computer {scissors}, You selection {paper}, Result : You Lost :(, try again :)")
if selection==scissors:
if machine_select==scissors:
print(f"Select the computer {scissors}, You selection {scissors}, Result : Draw, try again")
elif machine_select==paper:
print(f"Select the computer {paper}, You selection {scissors}, Result : You Win!..., felicitate..")
else:
print(f"Select the computer {Rock}, You selection {scissors}, Result : You Lost :(, try again :)")
if selection=="x":
print("Exit Program...Loading...")
break
Moderatör tarafında düzenlendi: