# dice game - scores # roll even number +10, roll odd -5 ( cant go below zero ) roll a double get an extra roll # Again, DONT JUST COPY THIS CODE, type it in yourself, please import random def roll(): d1 = random.randint(1,6) d2 = random.randint(1,6) #d1 = int(input("Enter d1 >>")) #d2 = int(input("Enter d2 >>")) d3 = 0 tot = d1 + d2 if tot % 2 ==0: # testing there for an even number #tot = tot +10 tot +=10 else: tot -= 5 # tot = tot -5 if tot < 0: tot = 0 if d1 == d2: # checking for both the same d3 = random.randint(1,6) tot += d3 #print("die1=",d1,"die2=", d2, "die3=",d3,"total=", tot) # for testing return tot #while True: for i in range(5): thisroll = roll() print(thisroll) #input() #print("die1=",d1,"die2=", d2, "die3=",d3,"total=", tot) #print("die1= " + str(d1) +" die2= " +str(d2) + " tot= " +str(tot)) # concatenation + casting