# ALlison Obourn
# CS 115, Autumn 2021
# Lecture 19

# This program simulates rolling two dice until the sum of the numbers that
# come up on them is equal to 7. Each roll and sum of the roll is printed out
# along the way and the number of times it took to finally get a 7 is output
# at the end.

from random import *

def main():
    sum_rolls = 0
    count = 0
    while sum_rolls != 7:
        roll1 = randint(1, 6)
        roll2 = randint(1, 6)
        sum_rolls = roll1 + roll2
        count = count + 1
        
        print(str(roll1) + " + " + str(roll2) + " = " + str(sum_rolls))

    print("You got a 7 in " + str(count) + " rolls")


main()
