Question: we have to write two programs in this solution 1. ) A program to count and print the number of occurences of all combinations in

we have to write two programs in this solution 1.) A program to count and print the number of occurences of all combinations in two dice roll 2.) A program to count the number of alphabets in a given string ******Roll.py****** #%% import matplotlib.pyplot as plt # plotting library, import numpy as np import random import seaborn as sns # seaborn: statistical data visualization, https://seaborn.pydata.org/ #%%  rolls = [random.randrange(1, 7) for i in range(600)] values, frequencies = np.unique(rolls, return_counts=True) title = f'Rolling a Six-Sided Die {len(rolls):,} Times'  #https://seaborn.pydata.org/tutorial/color_palettes.html#palette-tutorial axes = sns.barplot(values, frequencies, palette='bright')  axes.set_title(title) axes.set(xlabel='Die Value', ylabel='Frequency')  for bar, frequency in zip(axes.patches, frequencies):  text_x = bar.get_x() + bar.get_width() / 2.0  text_y = bar. get_height()  text = f'{frequency:,} {frequency / len (rolls):.1%}'  axes.text(text_x, text_y, text, fontsize=11, ha='center', va='bottom')  plt.show() #%% 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!