a = random.randint(1, 6)
if a != 6:
print(sum(a))
else:
print ("you lose, your score for this last round = 0")
in the above code, my attempt was to roll a single die, which will give a different number from 1 to 6 each time the program is run. I want to add those numbers each time its run (unless it's number 6, then the added numbers/scores reset)
say for example, I run the program and I rolled the number 2, then I run the program again and roll 5, I was hoping the program to show the sum of the two separate rolls as '7' adding the separate runs... and if I roll a third time and get '1' it adds to the last score 7 to get an 8 and so on, (until a 6 is rolled in the random dice game ,,which breaks all the loop and the score will be 0)