Question: Python Problem~ use while and if, no break and continue and try and expect plz In a dice rolling game a hand is made up
Python Problem~ use while and if, no break and continue and try and expect plz

In a dice rolling game a hand is made up of any number of random dice throws and is valued in the following way: In this game a run is a sequence of dice values starting from 1, e.g., 123, 12345, 1234, 1 Each dice which is part of a run of dice starting from a 1 has a value which is equivalent to the dice number. The value of any dice which is part of a run is added to the hand score. If there is no 1 in a hand of dice, the score for the whole hand is 0. A hand of dice can contain more than one run Study the following five example hands of dice and their corresponding valuation. Make sure you understand how the hands are valued: [5, 3, 2, 5, 4, 5, 6, 4, 31 has value 0 [3, 4, 1, 5, 3, 1, 4, 6] has value 2 (contains one run with just the dice [1] and a second run with just [1]) [5, 3, 2, 2, 6, 4, 5, 1, 4] has value 21 (contains one run with the dice [1, 2, 3, 4, 5, 6]) [2, 1, 1, 1, 2, 3, 3, 1, 3, 2] has value 19 (contains three separate runs with the dice [1, 2, 3 and a second run with the dice [1] [3, 4, 1, 5, 2, 1, 5, 1, 2, 3, 4, 6] has value 37 (contains one run with the dice [1, 2, 3, 4, 5, 6], a second run with [1, 2, 3, 4, 5] and a third run with the dice [1]) Complete the get_hand score() function which is passed a list of dice throws and returns the value of the hand according to the rules described above. def get_hand score(list of dice): return 0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
