Question: using python code, please help Exercise 8 When throwing a dice you can get integers between 1 and 6 . A streak of 6 is
Exercise 8 When throwing a dice you can get integers between 1 and 6 . A streak of 6 is when you get 6 several times in a row. Write a function longestStreakSi x which has a list as parameter. This list consists of integers between 1 and 6 (representing successive dice throws). The function should return the longest streak of 6. In the main program, generate a random list of integers between 1 and 6 based on a number provided by the user and then reveal the longest streak of 6 in this list, as per below sample runs: How many times do you want to roll the dice? 20 Output of dice rolls: [4,3,3,2,3,3,1,3,3,1,4,2,2,4,6,5,4, 2,5,3] Longest streak of 6:1 > How many times do you want to roll the dice? 20 Output of dice rolls: [4,3,4,5,3,1,5,3,4,6,2,4,6,6,2,3,5, 3,1,5] Longest streak of 6: 2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
