In this we are going to see a basic program of chinese cricket game in Python Programming Language.
import random
def game():
wickets = 3
score = 0
print("Welcome to the Cricket Game.")
print("You Have 3 Wickets.")
print("Good Luck!")
while wickets > 0:
runs = int(input("Enter the Number(1 to 6): "))
runs1 = random.randint(1, 6)
if runs == runs1:
print("Computer Number is: " + str(runs1))
print("Ohh It's An Wicket!")
print("------------xxxxxxxxxxxxxxx-------------------")
wickets -= 1
else:
print("Computer Number is: " + str(runs1))
score = score + runs
print("Your Score is: " + str(score))
print("You Are All Out !!")
print("Your Score is " + str(score))
game()
# Coded By DHIRAJ SHELKE
#ENJOY CODING
Post a Comment
FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP