Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
snake game counter
import random list=["snake","water","gun"] myscore=0 comp_score=0 counter=5 while(counter>0): print("enter any one option 1. snake 2.water 2.gun") option=input() print("you entered",option) choice=random.choice(list) print("computer generated option",choice) if option == "snake" and choice=="water": print("you won") myscore=myscore+1 elif option=="water"and choice=="snake": print("you lose sanp ne tujhe pi liya") comp_score=comp_score+1 elif option=="snake" and choice=="gun": print("you lose banduk se mar gaya snake") comp_score=comp+1 elif option=="water" and choice=="gun": print("you won") myscore=myscore+1 elif option=="gun" and choice=="snake": print("you won") myscore=myscore+1 elif option=="gun" and choice=="water": print("you lose banduk dub gay") comp_score=comp_score+1 elif option=="snake" and choice=="snake": print("sorry,better luck next time") elif option=="water" and choice=="water": print("sorry,better luck next time") elif option=="gun" and choice=="gun": print("sorry,better luck next time") else: print("enter a valid option") counter-=1 if myscore>comp_score: print("congratulations bhai aap jeet gaye") else: print("haar gaya tu")
run
|
edit
|
history
|
help
0
Brother's share
Lawrence.py
lhp-1
check the browser existence one by one
Linear search
Yogesh.py
regu
Python.py
Byear
linked_lists